Messages in this thread | | | From | "Luck, Tony" <> | Subject | RE: [PATCH] efi: fix out-of-bounds null overwrite vulnerability | Date | Fri, 8 Jan 2016 16:47:17 +0000 |
| |
> But this function doesn't use snprintf(), it uses scnprintf() which > returns the number of characters written into buf and, because > scnprintf() largely follows vnsprintf(), it will never write more than > 'size' bytes into the buffer.
if (bank && device) n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
That looks like "snprintf", not "scnprintf" to me :-)
What about using:
msg[len] = '\0';
to guarantee NUL termination?
-Tony
| |