summaryrefslogtreecommitdiff
path: root/include/hexdump.h
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-12-09 17:21:45 -0500
committerPeter Jones <pjones@redhat.com>2021-12-10 17:08:21 -0500
commitd0df9304c7a777557e1925dc9f75406ec00e6179 (patch)
treec55b6f81b17f39dfe72509425ef648de139c8c56 /include/hexdump.h
parent2e78cd93390f83648a20b5b3bb934f846537e54c (diff)
downloadefi-boot-shim-15.5-rc2.tar.gz
efi-boot-shim-15.5-rc2.zip
Minor coverity fixes15.5-rc2
- one missing free - one minor deadcode issue - two unchecked allocations - one debug hexdump of a variable we just freed Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include/hexdump.h')
-rw-r--r--include/hexdump.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/hexdump.h b/include/hexdump.h
index 1a20339b..e8f4fe1a 100644
--- a/include/hexdump.h
+++ b/include/hexdump.h
@@ -71,7 +71,7 @@ prepare_text(const void *data, size_t size, char *buf, unsigned int position)
else
buf[offset++] = '.';
}
- buf[offset++] = size > 0 ? '|' : 'X';
+ buf[offset++] = '|';
buf[offset] = '\0';
}
@@ -89,6 +89,11 @@ vhexdumpf(const char *file, int line, const char *func, const CHAR16 *const fmt,
if (verbose == 0)
return;
+ if (!data || !size) {
+ dprint(L"hexdump of a NULL pointer!\n");
+ return;
+ }
+
while (offset < size) {
char hexbuf[49];
char txtbuf[19];