Systemd/src/udev/scsi_id
Zbigniew Jędrzejewski-Szmek 099c77fd5f scsi_serial: replace some crazy strncpy() calls by strnlen()
gcc was warning about strncpy() leaving an unterminated string.
In this case, it was correct.

The code was doing strncpy()+strncat()+strlen() essentially to determine
if the strings have expected length. If the length was correct, a buffer
overread was performed (or at least some garbage bytes were used from the
uninitialized part of the buffer). Let's do the length check first and then
only copy stuff if everything agrees.

For some reason the function was called "prepend", when it obviously does
an "append".
2019-05-07 21:06:44 +02:00
..
README move imported udev into place 2012-04-04 05:05:07 +02:00
scsi.h tree-wide: replace 'unsigned int' with 'unsigned' 2018-10-19 22:19:12 +02:00
scsi_id.c udev: drop unnecessary brackets 2019-04-30 19:10:35 +02:00
scsi_id.h udev/scsi_id: drop unused udev struct 2018-09-10 18:27:36 +09:00
scsi_serial.c scsi_serial: replace some crazy strncpy() calls by strnlen() 2019-05-07 21:06:44 +02:00

scsi_id - generate a SCSI unique identifier for a given SCSI device

Please send questions, comments or patches to <patmans@us.ibm.com> or
<linux-hotplug-devel@lists.sourceforge.net>.