projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MAINTAINERS: nilfs2: add header file for tracing
[firefly-linux-kernel-4.4.55.git]
/
lib
/
hexdump.c
diff --git
a/lib/hexdump.c
b/lib/hexdump.c
index 8d74c20d8595c76d3882fcc02a7fa00f8db1bfaa..992457b1284c186d8e0d7b8c5d7b5fc349c18ef3 100644
(file)
--- a/
lib/hexdump.c
+++ b/
lib/hexdump.c
@@
-169,11
+169,15
@@
int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize,
}
} else {
for (j = 0; j < len; j++) {
}
} else {
for (j = 0; j < len; j++) {
- if (linebuflen < lx +
3
)
+ if (linebuflen < lx +
2
)
goto overflow2;
ch = ptr[j];
linebuf[lx++] = hex_asc_hi(ch);
goto overflow2;
ch = ptr[j];
linebuf[lx++] = hex_asc_hi(ch);
+ if (linebuflen < lx + 2)
+ goto overflow2;
linebuf[lx++] = hex_asc_lo(ch);
linebuf[lx++] = hex_asc_lo(ch);
+ if (linebuflen < lx + 2)
+ goto overflow2;
linebuf[lx++] = ' ';
}
if (j)
linebuf[lx++] = ' ';
}
if (j)