chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
bus: make sure we don't try to malloc 0 bytes
[elogind.git]
/
src
/
libsystemd-bus
/
bus-message.c
diff --git
a/src/libsystemd-bus/bus-message.c
b/src/libsystemd-bus/bus-message.c
index bc67c323808a6930729e4a5ff512793893bf6687..3f68435d21b9e72065e396f57166510d9864b713 100644
(file)
--- a/
src/libsystemd-bus/bus-message.c
+++ b/
src/libsystemd-bus/bus-message.c
@@
-1284,7
+1284,7
@@
static int part_make_space(
part->munmap_this = true;
} else {
- n = realloc(part->data,
sz
);
+ n = realloc(part->data,
MAX(sz, 1u)
);
if (!n) {
m->poisoned = true;
return -ENOMEM;