I've been implementing the "acl" command and was bitten by the fact
that serve_argument() does not NULL-terminates a list of arguments
received from the client. This does no harm because existing
server-side code always uses something like
for (i = 0; i < argc; i++)
and never something like
for (; *argv; argv++)
I'd like to do the latter (and it's obviously good to have more
traditional argv[]), so here is the patch:
2001-09-23 Alexey Mahotkin <[EMAIL PROTECTED]>
* server.c (serve_argument): NULL-terminate list of arguments
received from client.
--- server.c Sat Sep 8 19:33:24 2001
+++ server.c.new Sun Sep 23 01:25:26 2001
@@ -2120,7 +2120,7 @@
if (error_pending()) return;
- if (argument_vector_size <= argument_count)
+ if (argument_vector_size <= argument_count + 1)
{
argument_vector_size *= 2;
argument_vector =
@@ -2140,6 +2140,7 @@
}
strcpy (p, arg);
argument_vector[argument_count++] = p;
+ argument_vector[argument_count] = NULL;
}
static void
--alexm
_______________________________________________
Bug-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-cvs