]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libarchive/0001-Do-something-sensible-for-empty-strings-to-make-fuzz.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / libarchive / 0001-Do-something-sensible-for-empty-strings-to-make-fuzz.patch
1 From fa7438a0ff4033e4741c807394a9af6207940d71 Mon Sep 17 00:00:00 2001
2 From: Joerg Sonnenberger <joerg@bec.de>
3 Date: Tue, 5 Sep 2017 18:12:19 +0200
4 Subject: [PATCH] Do something sensible for empty strings to make fuzzers
5  happy.
6
7 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
8 ---
9 Upstream status: commit fa7438a0ff
10
11  libarchive/archive_read_support_format_xar.c | 8 +++++++-
12  1 file changed, 7 insertions(+), 1 deletion(-)
13
14 diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c
15 index 7a22beb9d8e4..93eeacc5e6eb 100644
16 --- a/libarchive/archive_read_support_format_xar.c
17 +++ b/libarchive/archive_read_support_format_xar.c
18 @@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt)
19         uint64_t l;
20         int digit;
21  
22 +       if (char_cnt == 0)
23 +               return (0);
24 +
25         l = 0;
26         digit = *p - '0';
27         while (digit >= 0 && digit < 10  && char_cnt-- > 0) {
28 @@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt)
29  {
30         int64_t l;
31         int digit;
32 -        
33 +
34 +       if (char_cnt == 0)
35 +               return (0);
36 +
37         l = 0;
38         while (char_cnt-- > 0) {
39                 if (*p >= '0' && *p <= '7')
40 -- 
41 2.14.1
42