[BusyBox-cvs] busybox/networking inetd.c,1.14,1.15
Erik Andersen
andersen at busybox.net
Tue Feb 17 20:04:37 UTC 2004
Update of /var/cvs/busybox/networking
In directory nail:/tmp/cvs-serv31531/networking
Modified Files:
inetd.c
Log Message:
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.
Index: inetd.c
===================================================================
RCS file: /var/cvs/busybox/networking/inetd.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- inetd.c 20 Jan 2004 15:32:39 -0000 1.14
+++ inetd.c 17 Feb 2004 20:04:34 -0000 1.15
@@ -426,7 +426,7 @@
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 @@
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;
More information about the busybox-cvs
mailing list