1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

escape: fix operator precedence in overflow check

CID#1535100

Follow-up for c6342e35b0
This commit is contained in:
Luca Boccassi 2024-03-07 00:46:19 +00:00
parent 73d8990930
commit 60cf40599a

View File

@ -454,7 +454,7 @@ char* octescape(const char *s, size_t len) {
if (len == SIZE_MAX)
len = strlen(s);
if (len > (SIZE_MAX)-1/4)
if (len > (SIZE_MAX - 1) / 4)
return NULL;
t = buf = new(char, len * 4 + 1);