mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
hexdecoct: add missing NULL check
Fixes oss-fuzz#54065 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54065). Fixes #25650.
This commit is contained in:
parent
6b0df52e58
commit
45655e776f
@ -606,7 +606,7 @@ ssize_t base64mem_full(
|
||||
if (!r)
|
||||
return -ENOMEM;
|
||||
|
||||
for (x = p; x < (const uint8_t*) p + (l / 3) * 3; x += 3) {
|
||||
for (x = p; x && x < (const uint8_t*) p + (l / 3) * 3; x += 3) {
|
||||
/* x[0] == XXXXXXXX; x[1] == YYYYYYYY; x[2] == ZZZZZZZZ */
|
||||
maybe_line_break(&z, r, line_break);
|
||||
*(z++) = base64char(x[0] >> 2); /* 00XXXXXX */
|
||||
|
BIN
test/fuzz/fuzz-resource-record/oss-fuzz-54065
Normal file
BIN
test/fuzz/fuzz-resource-record/oss-fuzz-54065
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user