summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-11-23 09:18:40 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-11-23 09:37:12 +0000
commitc9690b0e7cdb977184e9649cd1bd3688787c1fb5 (patch)
tree501f0c68c3cc308f0ff8009b6d20e9cd1a5e8231 /src/blob.c
parent37e8f803a531caac144b075a127f48b7c38fc747 (diff)
downloadapk-tools-c9690b0e7cdb977184e9649cd1bd3688787c1fb5.tar.gz
apk-tools-c9690b0e7cdb977184e9649cd1bd3688787c1fb5.tar.bz2
apk-tools-c9690b0e7cdb977184e9649cd1bd3688787c1fb5.tar.xz
apk-tools-c9690b0e7cdb977184e9649cd1bd3688787c1fb5.zip
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.
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/blob.c b/src/blob.c
index 83bcf80..70004e6 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -18,7 +18,7 @@ char *apk_blob_cstr(apk_blob_t blob)
{
char *cstr;
- if (blob.ptr == NULL)
+ if (blob.len == 0)
return strdup("");
if (blob.ptr[blob.len-1] == 0)