aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_read_support_format_warc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_read_support_format_warc.c')
-rw-r--r--libarchive/archive_read_support_format_warc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c
index e8fc8428b41e..c1c54450c396 100644
--- a/libarchive/archive_read_support_format_warc.c
+++ b/libarchive/archive_read_support_format_warc.c
@@ -744,8 +744,9 @@ _warc_rdlen(const char *buf, size_t bsz)
/* there must be at least one digit */
if (!isdigit((unsigned char)*val))
return -1;
+ errno = 0;
len = strtol(val, &on, 10);
- if (on != eol) {
+ if (errno != 0 || on != eol) {
/* line must end here */
return -1;
}