Bug 13437 - found overlapping data buffer
Summary: found overlapping data buffer
Status: CLOSED CODE_FIX
Alias: None
Product: SCSI Drivers
Classification: Unclassified
Component: GDT SCSI (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: scsi_drivers-gdt-scsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-03 14:16 UTC by Martin Ettl
Modified: 2009-06-18 09:06 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: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.

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