Bug 13438 - found overlapping data buffer
Summary: found overlapping data buffer
Status: CLOSED CODE_FIX
Alias: None
Product: SCSI Drivers
Classification: Unclassified
Component: QLOGIC QLA2XXX (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: scsi_drivers-qla2xxx
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-03 14:20 UTC by Martin Ettl
Modified: 2009-06-18 08:57 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.29.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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 :-(

Note You need to log in before you can comment on or make changes to this bug.