summaryrefslogtreecommitdiff
path: root/libexec/ld.so/sod.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2014-06-21 08:00:24 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2014-06-21 08:00:24 +0000
commit029bd623b840ee0c0ca16b03d9a1ee177cdd31e9 (patch)
treeadcd53bff97a1881f29c5f29d7f1fe74acce03b8 /libexec/ld.so/sod.c
parentd03a8d539ef55e2af53ca76005a541a0b2fdd808 (diff)
Move to a non-zeroing _dl_malloc, a _dl_calloc and _dl_reallocarry and
fix _dl_strdup to return NULL instead of crash; ok deraadt@
Diffstat (limited to 'libexec/ld.so/sod.c')
-rw-r--r--libexec/ld.so/sod.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libexec/ld.so/sod.c b/libexec/ld.so/sod.c
index 2f9ffb73847..4142ce6b5d7 100644
--- a/libexec/ld.so/sod.c
+++ b/libexec/ld.so/sod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sod.c,v 1.27 2013/12/03 01:47:05 deraadt Exp $ */
+/* $OpenBSD: sod.c,v 1.28 2014/06/21 08:00:23 otto Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -64,6 +64,7 @@ _dl_build_sod(const char *name, struct sod *sodp)
char *realname, *tok, *etok, *cp;
/* default is an absolute or relative path */
+ /* XXX */
sodp->sod_name = (long)_dl_strdup(name); /* strtok is destructive */
sodp->sod_library = 0;
sodp->sod_major = sodp->sod_minor = 0;
@@ -121,6 +122,7 @@ _dl_build_sod(const char *name, struct sod *sodp)
if (realname == NULL)
goto backout;
cp = (char *)sodp->sod_name;
+ /* XXX */
sodp->sod_name = (long)_dl_strdup(realname);
_dl_free(cp);
sodp->sod_library = 1;
@@ -130,6 +132,7 @@ _dl_build_sod(const char *name, struct sod *sodp)
backout:
_dl_free((char *)sodp->sod_name);
+ /* XXX */
sodp->sod_name = (long)_dl_strdup(name);
}