Commit c9690b0e authored by Natanael Copa's avatar Natanael Copa

blob: fix segfault on x86_64 with --virtual

blob.ptr might be non-null on empty field in /var/lib/apk/installed
so we compare with blob length.

This fixes a segfault on x86_64.
parent 37e8f803
...@@ -18,7 +18,7 @@ char *apk_blob_cstr(apk_blob_t blob) ...@@ -18,7 +18,7 @@ char *apk_blob_cstr(apk_blob_t blob)
{ {
char *cstr; char *cstr;
if (blob.ptr == NULL) if (blob.len == 0)
return strdup(""); return strdup("");
if (blob.ptr[blob.len-1] == 0) if (blob.ptr[blob.len-1] == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment