diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-09-03 13:15:10 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-09-03 13:15:10 +0000 |
commit | 330dc5511ae7c107e8c84833ea0887ced07c002b (patch) | |
tree | 73ab20662f1c2de5b588e00aab5fd2cdb2c42f22 /src | |
parent | 58e771303c95f9d97d009602516b509866c3fb5a (diff) | |
download | apk-tools-330dc5511ae7c107e8c84833ea0887ced07c002b.tar.gz apk-tools-330dc5511ae7c107e8c84833ea0887ced07c002b.tar.bz2 apk-tools-330dc5511ae7c107e8c84833ea0887ced07c002b.tar.xz apk-tools-330dc5511ae7c107e8c84833ea0887ced07c002b.zip |
index: do not segfault if there are no description
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/index.c b/src/index.c index ac6a763..fffa739 100644 --- a/src/index.c +++ b/src/index.c @@ -173,11 +173,13 @@ static int index_main(void *ctx, struct apk_database *db, int argc, char **argv) os = apk_ostream_gzip(os); - memset(&fi, 0, sizeof(fi)); - fi.mode = 0644 | S_IFREG; - fi.name = "DESCRIPTION"; - fi.size = strlen(ictx->description); - apk_tar_write_entry(os, &fi, ictx->description); + if (ictx->description != NULL) { + memset(&fi, 0, sizeof(fi)); + fi.mode = 0644 | S_IFREG; + fi.name = "DESCRIPTION"; + fi.size = strlen(ictx->description); + apk_tar_write_entry(os, &fi, ictx->description); + } memset(&fi, 0, sizeof(fi)); fi.mode = 0644 | S_IFREG; |