[PATCH] arch: parisc: kernel: memory overflow, 'name' length is too short for using

2013-05-26 Thread Chen Gang
'path.bc[i]' can be asigned by PCI_SLOT() which can '> 10', so sizeof(6 * "%u:" + "%u" + '\0') may be 21. Since 'name' length is 20, it may be memory overflow. And 'path.bc[i]' is 'unsigned char' for printing, we can be sure the max length of 'name' must be less than 28. So simplify thinking,

[PATCH] arch: parisc: kernel: memory overflow, 'name' length is too short for using

2013-05-26 Thread Chen Gang
'path.bc[i]' can be asigned by PCI_SLOT() which can ' 10', so sizeof(6 * %u: + %u + '\0') may be 21. Since 'name' length is 20, it may be memory overflow. And 'path.bc[i]' is 'unsigned char' for printing, we can be sure the max length of 'name' must be less than 28. So simplify thinking, we