Bug 13437

Summary: found overlapping data buffer
Product: SCSI Drivers Reporter: Martin Ettl (ettl.martin)
Component: GDT SCSIAssignee: scsi_drivers-gdt-scsi
Status: CLOSED CODE_FIX    
Severity: normal CC: alan, bugzilla.kernel.org
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.29.3 Subsystem:
Regression: No Bisected commit-id:

Description Martin Ettl 2009-06-03 14:16:35 UTC
Hello,

i detected an overlapping data buffer at file "linux-2.6.29.3/drivers/scsi/gdth_proc.c"
For detection, i used the static code analysis tool cppcheck. It prints the following message:
[linux-2.6.29.3/drivers/scsi/gdth_proc.c:199]: (error) Overlapping data buffer hrec

Take a loop at file gdth_proc.c at line 199:

            sprintf(hrec,"%s,%d", hrec, reserve_list[i]);

Here, hrec is used by iteself at the sprintf statement, this is dangerous!!!!

Best regards

Ettl Martin
Comment 1 Marc Bejarano 2009-06-18 03:09:24 UTC
alan: have a commit id for the fix handy?
Comment 2 Marc Bejarano 2009-06-18 04:50:40 UTC
patch: http://permalink.gmane.org/gmane.linux.scsi/51819
Comment 3 Martin Ettl 2009-06-18 07:57:41 UTC
To my mind, this can be closed here.