From 96a7c09747d71ff61a373d73fe917007d1280df3 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 19 Aug 2009 19:38:18 +0000 Subject: In ldconfig the dewey field of shlib_list was only partially filled as bcopy used the number of elements instead of the array's size. As a consequence, the wrong version of a library could be selected if the library had many minor numbers. from Christian Rusch; ok otto@ --- libexec/ld.so/ldconfig/ldconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/ld.so/ldconfig/ldconfig.c b/libexec/ld.so/ldconfig/ldconfig.c index 8fac2620e35..6617937cbdb 100644 --- a/libexec/ld.so/ldconfig/ldconfig.c +++ b/libexec/ld.so/ldconfig/ldconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldconfig.c,v 1.25 2006/06/26 23:26:12 drahn Exp $ */ +/* $OpenBSD: ldconfig.c,v 1.26 2009/08/19 19:38:17 bluhm Exp $ */ /* * Copyright (c) 1993,1995 Paul Kranenburg @@ -289,7 +289,7 @@ enter(char *dir, char *file, char *name, int dewey[], int ndewey) shp = (struct shlib_list *)xmalloc(sizeof *shp); shp->name = xstrdup(name); shp->path = concat(dir, "/", file); - bcopy(dewey, shp->dewey, MAXDEWEY); + bcopy(dewey, shp->dewey, sizeof(shp->dewey)); shp->ndewey = ndewey; shp->next = NULL; -- cgit v1.2.3