diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-11-23 09:18:40 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-11-23 09:37:12 +0000 |
commit | c9690b0e7cdb977184e9649cd1bd3688787c1fb5 (patch) | |
tree | 501f0c68c3cc308f0ff8009b6d20e9cd1a5e8231 /src | |
parent | 37e8f803a531caac144b075a127f48b7c38fc747 (diff) | |
download | apk-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')
-rw-r--r-- | src/blob.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |