From: Eric Andersen Date: Mon, 11 Dec 2000 20:29:13 +0000 (-0000) Subject: Patch from larry doolittle to make sure we don't realloc X-Git-Tag: 0_48~22 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d323d32c5bba8e21bcd1e3df511f8d842a5d5457;p=oweals%2Fbusybox.git Patch from larry doolittle to make sure we don't realloc a pointer that was not yet malloced mem. --- diff --git a/logger.c b/logger.c index 669a2d601..f5c776ddf 100644 --- a/logger.c +++ b/logger.c @@ -151,6 +151,7 @@ extern int logger_main(int argc, char **argv) } else { if (argc >= 1) { int len = 1; /* for the '\0' */ + message=xcalloc(1, 1); for (; *argv != NULL; argv++) { len += strlen(*argv); len += 1; /* for the space between the args */ diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 669a2d601..f5c776ddf 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -151,6 +151,7 @@ extern int logger_main(int argc, char **argv) } else { if (argc >= 1) { int len = 1; /* for the '\0' */ + message=xcalloc(1, 1); for (; *argv != NULL; argv++) { len += strlen(*argv); len += 1; /* for the space between the args */