aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-02-17 20:04:34 +0000
committerEric Andersen <andersen@codepoet.org>2004-02-17 20:04:34 +0000
commit60bb3f31af5b26fdd2e13f82e83c78f0231704f3 (patch)
treef5f09a26c5297e8a7fc2c07efd284532ca75c4a3
parent01cdb66987906ca375feeaa9ff71b91c8469756c (diff)
downloadbusybox-60bb3f31af5b26fdd2e13f82e83c78f0231704f3.tar.gz
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.
-rw-r--r--networking/inetd.c7
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:
sep->se_argv[argc++] = NULL;
}
- free(cp);
+ //free(cp); // BUG: cp is the argv[] container; we must not free it here!
return (sep);
}
@@ -589,7 +589,10 @@ static void config(int signum)
SWAP(char *, sep->se_argv[i], cp->se_argv[i]);
#undef SWAP
sigprocmask(SIG_SETMASK, &oldmask, NULL);
- freeconfig(cp);
+ // This freeconfig() is probably a bug, since it will try and free()
+ // each of the argv[] values, which are really just pointers
+ // into the middle of a single line buffer for the config file.
+ //freeconfig(cp); // BUG?
} else {
sep = (struct servtab *)xmalloc(sizeof (*sep));
*sep = *cp;