Skip to content

Commit 60e72eb

Browse files
committed
xml BUGFIX proper overflow check
1 parent cd3eb56 commit 60e72eb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ lyxml_parse_value_use_buf(const struct ly_ctx *ctx, const char **in, uint32_t *o
412412
}
413413

414414
/* overflow check */
415-
req_size = *len + *offset + need_space;
415+
req_size = (uint64_t)*len + (uint64_t)*offset + (uint64_t)need_space;
416416
if (req_size > UINT32_MAX) {
417417
LOGVAL(ctx, NULL, LYVE_SYNTAX, "XML value too long.");
418418
return LY_EINVAL;

0 commit comments

Comments
 (0)