binutils/binutils-CVE-2017-12967.patch

12 lines
407 B
Diff
Raw Permalink Normal View History

--- binutils.orig/bfd/tekhex.c 2018-05-31 10:14:28.056641473 +0100
+++ binutils-2.29/bfd/tekhex.c 2018-05-31 11:41:13.185681254 +0100
@@ -307,7 +307,7 @@ getsym (char *dstp, char **srcp, unsigne
len = hex_value (*src++);
if (len == 0)
len = 16;
- for (i = 0; i < len && src < endp; i++)
+ for (i = 0; i < len && (src + i) < endp; i++)
dstp[i] = src[i];
dstp[i] = 0;
*srcp = src + i;