couple of valgrind error squash patches

Jeremy Allison jra at samba.org
Tue Jan 10 23:33:22 UTC 2017


On Tue, Jan 10, 2017 at 04:41:14PM +0000, Noel Power wrote:
> Please have a look and push if they are ok
> 
> 
> Noel
> 

> From 801e5ac9e0c3bdffcc5ce7ebd9130a766afd7346 Mon Sep 17 00:00:00 2001
> From: Noel Power <noel.power at suse.com>
> Date: Mon, 9 Jan 2017 15:11:01 +0000
> Subject: [PATCH 1/2] squash valgrind "Conditional jump or move depends on..."
>  err
> 
> ==14890== Conditional jump or move depends on uninitialised value(s)
> ==14890==    at 0x86E1458: _itoa_word (in /lib64/libc-2.22.so)
> ==14890==    by 0x86E4CA1: vfprintf (in /lib64/libc-2.22.so)
> ==14890==    by 0x870D132: vasprintf (in /lib64/libc-2.22.so)
> ==14890==    by 0x71B3C18: __dbgtext_va (debug.c:1361)
> ==14890==    by 0x71B3D1A: dbgtext (debug.c:1382)
> ==14890==    by 0x119D9B: process_workgroup_announce (nmbd_incomingdgrams.c:212)
> ==14890==    by 0x1264ED: process_browse_packet (nmbd_packets.c:1097)
> ==14890==    by 0x127340: process_dgram (nmbd_packets.c:1299)
> ==14890==    by 0x12803C: run_packet_queue (nmbd_packets.c:1606)
> ==14890==    by 0x1126CE: process (nmbd.c:540)
> ==14890==    by 0x1138F4: main (nmbd.c:1100)
> ==14890==  Uninitialised value was created by a stack allocation
> ==14890==    at 0x119B89: process_workgroup_announce (nmbd_incomingdgrams.c:197)
> 
> Signed-off-by: Noel Power <noel.power at suse.com>
> ---
>  source3/nmbd/nmbd_incomingdgrams.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/source3/nmbd/nmbd_incomingdgrams.c b/source3/nmbd/nmbd_incomingdgrams.c
> index 6fedcfd..900d7dc 100644
> --- a/source3/nmbd/nmbd_incomingdgrams.c
> +++ b/source3/nmbd/nmbd_incomingdgrams.c
> @@ -204,6 +204,7 @@ void process_workgroup_announce(struct subnet_record *subrec, struct packet_stru
>  	unstring source_name;
>  	unstring dest_name;
>  
> +	ZERO_STRUCT(source_name);
>  	pull_ascii_nstring(workgroup_announce_name,sizeof(workgroup_announce_name),buf+5);
>  	pull_ascii_nstring(master_name,sizeof(master_name),buf+31);
>  	pull_ascii_nstring(source_name,sizeof(source_name),dgram->source_name.name);
> -- 
> 2.10.2

LGTM on the above patch. Can I get a second Team reviewer ?



More information about the samba-technical mailing list