Bug 13438

Summary: found overlapping data buffer
Product: SCSI Drivers Reporter: Martin Ettl (ettl.martin)
Component: QLOGIC QLA2XXXAssignee: scsi_drivers-qla2xxx
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:20:31 UTC
Hello,

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


Take a loop at file qla_attr.c at line 545:

		return snprintf(buf, PAGE_SIZE, "%s\n", buf);

Here, buf is used by iteself, this is dangerous!!!!

Best regards

Ettl Martin
Comment 1 Marc Bejarano 2009-06-18 04:49:18 UTC
patch: http://permalink.gmane.org/gmane.linux.scsi/51819

Status: CLOSED PATCH_ALREADY_AVAILABLE hardly seems fair since the patch was posted after the report, no?
Comment 2 Martin Ettl 2009-06-18 07:59:02 UTC
Yes, life is not fair :-(