Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atm: firestream: add more reserved strings

This bug was there when the driver was first added in back in year 2000.
It causes a Smatch warning:

drivers/atm/firestream.c:849 process_incoming()
error: buffer overflow 'res_strings' 60 <= 63

There are supposed to be 64 entries in this array and the missing
strings are clearly in the 30 40 range. I added them as reserved 37 to
reserved 40. It's possible that strings are really supposed to be added
in the middle instead of at the end, but this approach is safe, in that
it fixes the bug and doesn't break anything that wasn't already broken.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dan Carpenter and committed by
David S. Miller
86f04396 ce577668

+5 -1
+5 -1
drivers/atm/firestream.c
··· 181 181 "reserved 27", 182 182 "reserved 28", 183 183 "reserved 29", 184 - "reserved 30", 184 + "reserved 30", /* FIXME: The strings between 30-40 might be wrong. */ 185 185 "reassembly abort: no buffers", 186 186 "receive buffer overflow", 187 187 "change in GFC", 188 188 "receive buffer full", 189 189 "low priority discard - no receive descriptor", 190 190 "low priority discard - missing end of packet", 191 + "reserved 37", 192 + "reserved 38", 193 + "reserved 39", 194 + "reseverd 40", 191 195 "reserved 41", 192 196 "reserved 42", 193 197 "reserved 43",