Author: vlendec Date: 2007-07-29 09:51:06 +0000 (Sun, 29 Jul 2007) New Revision: 24069
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24069 Log: Fix Coverity ID 368. We would segfault if 0 < data.dsize < 8 Modified: branches/SAMBA_3_2/source/printing/notify.c branches/SAMBA_3_2_0/source/printing/notify.c Changeset: Modified: branches/SAMBA_3_2/source/printing/notify.c =================================================================== --- branches/SAMBA_3_2/source/printing/notify.c 2007-07-29 09:23:55 UTC (rev 24068) +++ branches/SAMBA_3_2/source/printing/notify.c 2007-07-29 09:51:06 UTC (rev 24069) @@ -553,7 +553,7 @@ pid_list = NULL; } - for( i = 0, offset = 0; offset < data.dsize; offset += 8, i++) + for( i = 0, offset = 0; i < num_pids; offset += 8, i++) pid_list[i] = (pid_t)IVAL(data.dptr, offset); *pp_pid_list = pid_list; Modified: branches/SAMBA_3_2_0/source/printing/notify.c =================================================================== --- branches/SAMBA_3_2_0/source/printing/notify.c 2007-07-29 09:23:55 UTC (rev 24068) +++ branches/SAMBA_3_2_0/source/printing/notify.c 2007-07-29 09:51:06 UTC (rev 24069) @@ -553,7 +553,7 @@ pid_list = NULL; } - for( i = 0, offset = 0; offset < data.dsize; offset += 8, i++) + for( i = 0, offset = 0; i < num_pids; offset += 8, i++) pid_list[i] = (pid_t)IVAL(data.dptr, offset); *pp_pid_list = pid_list;
