empty crash log shouldn't crash itself
authorVolker Birk <vb@pep.foundation>
Sat, 24 Feb 2018 10:57:24 +0100
changeset 25324d46b7dd0fce
parent 2531 68b7fb2ad5b2
child 2534 9d17c132c770
child 2535 76edc488ccdd
empty crash log shouldn't crash itself
src/pEpEngine.c
     1.1 --- a/src/pEpEngine.c	Thu Feb 22 17:18:24 2018 +0100
     1.2 +++ b/src/pEpEngine.c	Sat Feb 24 10:57:24 2018 +0100
     1.3 @@ -3411,8 +3411,16 @@
     1.4      } while (result != SQLITE_DONE);
     1.5  
     1.6      sqlite3_reset(session->crashdump);
     1.7 -    if (status == PEP_STATUS_OK)
     1.8 -        *logdata = _logdata;
     1.9 +    if (status == PEP_STATUS_OK) {
    1.10 +        if (_logdata) {
    1.11 +            *logdata = _logdata;
    1.12 +        }
    1.13 +        else {
    1.14 +            *logdata = strdup("");
    1.15 +            if (!*logdata)
    1.16 +                goto enomem;
    1.17 +        }
    1.18 +    }
    1.19  
    1.20      goto the_end;
    1.21