Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 38349: /trunk/ /trunk/: capture_sync

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 5 Aug 2011 00:28:51 -0700
On Aug 5, 2011, at 12:10 AM, tuexen@xxxxxxxxxxxxx wrote:

> http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=38349
> 
> User: tuexen
> Date: 2011/08/05 12:10 AM
> 
> Log:
> Generate the capure sync pipe correctly.
> Fix obtained from Irene Ruengeler.
> 
> Directory: /trunk/
>  Changes    Path              Action
>  +37 -15    capture_sync.c    Modified

	...

> @@ -133,8 +134,8 @@
>  
>      /* Stuff the pointer into the penultimate element of the array, which
>         is the one at the index specified by "*argc". */
> -    args[*argc] = arg;
> -
> +    temparg = g_strdup_printf("%s", arg);
> +    args[*argc] = temparg;
>      /* Now bump the count. */
>      (*argc)++;

Would not

	args[*argc] = g_strdup(arg);

suffice?

(Presumably the problem was that something was modifying "arg" after the call to sync_pipe_add_arg() but before the spawning of the child process.)