diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-02-17 20:04:34 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-02-17 20:04:34 +0000 |
commit | 7d843f0baa30470c7f65a6e24b210ae459342da3 (patch) | |
tree | f5f09a26c5297e8a7fc2c07efd284532ca75c4a3 /networking | |
parent | cc83cc396fc52644faa508ba2cbf049bc2a69ec2 (diff) | |
download | busybox-w32-7d843f0baa30470c7f65a6e24b210ae459342da3.tar.gz busybox-w32-7d843f0baa30470c7f65a6e24b210ae459342da3.tar.bz2 busybox-w32-7d843f0baa30470c7f65a6e24b210ae459342da3.zip |
Mark Lord writes:
The config file processing for inetd in busybox-1.00-pre7 and newer
is broken -- the saved command argv[] values overwrite each other.
Patch to fix it is attached.
Cheers
--
Mark Lord
Real-Time Remedies Inc.
git-svn-id: svn://busybox.net/trunk/busybox@8502 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-rw-r--r-- | networking/inetd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index eb61299c2..2906b3c0a 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -426,7 +426,7 @@ more: | |||
426 | sep->se_argv[argc++] = NULL; | 426 | sep->se_argv[argc++] = NULL; |
427 | } | 427 | } |
428 | 428 | ||
429 | free(cp); | 429 | //free(cp); // BUG: cp is the argv[] container; we must not free it here! |
430 | return (sep); | 430 | return (sep); |
431 | } | 431 | } |
432 | 432 | ||
@@ -589,7 +589,10 @@ static void config(int signum) | |||
589 | SWAP(char *, sep->se_argv[i], cp->se_argv[i]); | 589 | SWAP(char *, sep->se_argv[i], cp->se_argv[i]); |
590 | #undef SWAP | 590 | #undef SWAP |
591 | sigprocmask(SIG_SETMASK, &oldmask, NULL); | 591 | sigprocmask(SIG_SETMASK, &oldmask, NULL); |
592 | freeconfig(cp); | 592 | // This freeconfig() is probably a bug, since it will try and free() |
593 | // each of the argv[] values, which are really just pointers | ||
594 | // into the middle of a single line buffer for the config file. | ||
595 | //freeconfig(cp); // BUG? | ||
593 | } else { | 596 | } else { |
594 | sep = (struct servtab *)xmalloc(sizeof (*sep)); | 597 | sep = (struct servtab *)xmalloc(sizeof (*sep)); |
595 | *sep = *cp; | 598 | *sep = *cp; |