systemd: merge branch systemd into master
This commit is contained in:
@@ -606,10 +606,11 @@ static int base64_append_width(
|
||||
lines = DIV_ROUND_UP(len, width);
|
||||
|
||||
slen = strlen_ptr(sep);
|
||||
if (lines > (SSIZE_MAX - plen - 1 - slen) / (indent + width + 1))
|
||||
if (plen >= SSIZE_MAX - 1 - slen ||
|
||||
lines > (SSIZE_MAX - plen - 1 - slen) / (indent + width + 1))
|
||||
return -ENOMEM;
|
||||
|
||||
t = realloc(*prefix, plen + 1 + slen + (indent + width + 1) * lines);
|
||||
t = realloc(*prefix, (ssize_t) plen + 1 + slen + (indent + width + 1) * lines);
|
||||
if (!t)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -644,7 +645,7 @@ int base64_append(
|
||||
return base64_append_width(prefix, plen, "\n", indent, p, l, width - indent - 1);
|
||||
else
|
||||
/* leave plen on the left, keep last column free */
|
||||
return base64_append_width(prefix, plen, NULL, plen, p, l, width - plen - 1);
|
||||
return base64_append_width(prefix, plen, " ", plen, p, l, width - plen - 1);
|
||||
}
|
||||
#endif /* NM_IGNORED */
|
||||
|
||||
|
Reference in New Issue
Block a user