index: do not segfault if there are no description
parent
58e771303c
commit
330dc5511a
|
@ -173,11 +173,13 @@ static int index_main(void *ctx, struct apk_database *db, int argc, char **argv)
|
||||||
|
|
||||||
os = apk_ostream_gzip(os);
|
os = apk_ostream_gzip(os);
|
||||||
|
|
||||||
|
if (ictx->description != NULL) {
|
||||||
memset(&fi, 0, sizeof(fi));
|
memset(&fi, 0, sizeof(fi));
|
||||||
fi.mode = 0644 | S_IFREG;
|
fi.mode = 0644 | S_IFREG;
|
||||||
fi.name = "DESCRIPTION";
|
fi.name = "DESCRIPTION";
|
||||||
fi.size = strlen(ictx->description);
|
fi.size = strlen(ictx->description);
|
||||||
apk_tar_write_entry(os, &fi, ictx->description);
|
apk_tar_write_entry(os, &fi, ictx->description);
|
||||||
|
}
|
||||||
|
|
||||||
memset(&fi, 0, sizeof(fi));
|
memset(&fi, 0, sizeof(fi));
|
||||||
fi.mode = 0644 | S_IFREG;
|
fi.mode = 0644 | S_IFREG;
|
||||||
|
|
Loading…
Reference in New Issue