diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | xmalloc.c | 7 |
2 files changed, 7 insertions, 5 deletions
@@ -26,6 +26,9 @@ | |||
26 | - stevesk@cvs.openbsd.org 2001/07/23 18:14:58 | 26 | - stevesk@cvs.openbsd.org 2001/07/23 18:14:58 |
27 | [auth2.c auth-rsa.c] | 27 | [auth2.c auth-rsa.c] |
28 | use %lu; ok markus@ | 28 | use %lu; ok markus@ |
29 | - stevesk@cvs.openbsd.org 2001/07/23 18:21:46 | ||
30 | [xmalloc.c] | ||
31 | no zero size xstrdup() error; ok markus@ | ||
29 | 32 | ||
30 | 20010803 | 33 | 20010803 |
31 | - (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on | 34 | - (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on |
@@ -6136,4 +6139,4 @@ | |||
6136 | - Wrote replacements for strlcpy and mkdtemp | 6139 | - Wrote replacements for strlcpy and mkdtemp |
6137 | - Released 1.0pre1 | 6140 | - Released 1.0pre1 |
6138 | 6141 | ||
6139 | $Id: ChangeLog,v 1.1433 2001/08/06 21:01:49 mouring Exp $ | 6142 | $Id: ChangeLog,v 1.1434 2001/08/06 21:03:23 mouring Exp $ |
@@ -13,7 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "includes.h" | 15 | #include "includes.h" |
16 | RCSID("$OpenBSD: xmalloc.c,v 1.15 2001/04/16 08:05:34 deraadt Exp $"); | 16 | RCSID("$OpenBSD: xmalloc.c,v 1.16 2001/07/23 18:21:46 stevesk Exp $"); |
17 | 17 | ||
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
19 | #include "log.h" | 19 | #include "log.h" |
@@ -58,11 +58,10 @@ xfree(void *ptr) | |||
58 | char * | 58 | char * |
59 | xstrdup(const char *str) | 59 | xstrdup(const char *str) |
60 | { | 60 | { |
61 | size_t len = strlen(str) + 1; | 61 | size_t len; |
62 | char *cp; | 62 | char *cp; |
63 | 63 | ||
64 | if (len == 0) | 64 | len = strlen(str) + 1; |
65 | fatal("xstrdup: zero size"); | ||
66 | cp = xmalloc(len); | 65 | cp = xmalloc(len); |
67 | strlcpy(cp, str, len); | 66 | strlcpy(cp, str, len); |
68 | return cp; | 67 | return cp; |