config: value_to_pt_or_px(): don’t allow empty px values (key=px)

This commit is contained in:
Daniel Eklöf 2022-12-17 10:25:16 +01:00
parent 59018446fd
commit 7bf150c11a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -651,7 +651,7 @@ value_to_pt_or_px(struct context *ctx, struct pt_or_px *res)
char *end = NULL;
long value = strtol(s, &end, 10);
if (!(errno == 0 && end == s + len - 2)) {
if (!(len > 2 && errno == 0 && end == s + len - 2)) {
LOG_CONTEXTUAL_ERR("invalid px value (must be in the form 12px)");
return false;
}