Commit 7b870da0 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

Check for number of arguments instead of a NULL argument.

Thanks to Masamichi Takagi @ NEC, Japan for reporting the error and
suggesting the patch.  The cached PUTs array was not reinitialized to
NULL values after the first time they were sent upstream and cleared.
So the next time we push them upstream, they contained garbage data
causing segfaults.  This patch looks for the number of arguments
rather than a NULL argument as a termination detector.
Signed-off-by: default avatarMasamichi Takagi <>
parent 66b8196b
......@@ -46,7 +46,7 @@ static HYD_status send_cmd_upstream(const char *start, int fd, int num_args, cha
j = 0;
tmp[j++] = HYDU_strdup(start);
for (i = 0; args[i]; i++) {
for (i = 0; i < num_args; i++) {
tmp[j++] = HYDU_strdup(args[i]);
if (args[i + 1])
tmp[j++] = HYDU_strdup(" ");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment