On Mon 04 Aug 2014 08:35:02 zubin.mit...@gmail.com wrote:
> From: Zubin Mithra <zubin.mit...@gmail.com>
> 
> * desc.c (decode_select): Initialize fds to NULL.
> * strace.c (expand_tcbtab): Change type to unsigned.
> (startup_child): Initialize pathname array.

you need to describe why you're making a change, not just how

> --- a/desc.c
> +++ b/desc.c
> @@ -314,7 +314,7 @@ decode_select(struct tcb *tcp, long *args, enum
> bitness_t bitness) {
>       int i, j;
>       int nfds, fdsize;
> -     fd_set *fds;
> +     fd_set *fds = NULL;
>       const char *sep;
>       long arg;

why ?  i guess you're handling the case where nfds==0 ?  seems like fds is 
used uninitialized in that case.

however, if you do this, you'll see that the nfds<0 check also sets fds to 
NULL, so you should delete that line.

> --- a/strace.c
> +++ b/strace.c
> @@ -675,7 +675,7 @@ expand_tcbtab(void)
>          callers have pointers and it would be a pain.
>          So tcbtab is a table of pointers.  Since we never
>          free the TCBs, we allocate a single chunk of many.  */
> -     int i = tcbtabsize;
> +     unsigned int i = tcbtabsize;

i guess this is because tcpbtabsize is unsigned, and i is only used to compare 
to that.

> @@ -1160,7 +1160,7 @@ startup_child(char **argv)
>  {
>       struct_stat statbuf;
>       const char *filename;
> -     char pathname[MAXPATHLEN];
> +     char pathname[MAXPATHLEN] = "";
>       int pid;
>       struct tcb *tcp;

i'm not seeing a problem here.  pathname looks like it's always initialized 
before it's used.  note that sizeof(pathname) is not using the value of 
pathname, so those checks don't count ...
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to