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

From: Michael Tuexen <Michael.Tuexen@xxxxxxxxxxxxxxxxx>
Date: Fri, 5 Aug 2011 10:12:09 +0200
On Aug 5, 2011, at 9:28 AM, Guy Harris wrote:

> 
> 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?
It does. Committed in r38351.

Thanks for pointing it out.

Best regards
Michael
> 
> (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.)
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
>