mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
hexdecoct: add missing NULL check
Fixes oss-fuzz#54065 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54065). Fixes #25650. (cherry picked from commit 45655e776f3a4deaf68cc21a7716eba5181cbd49) (cherry picked from commit 002fc46688e7d7057dbd7845defcc5bae758adde)
This commit is contained in:
parent
82a6ac3a2c
commit
671ea8cce4
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user