summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3de174c)
If a file is renamed and re-added the old code would segfault because of
a NULL pointer dereference in save_chunk_table(). Fix is trivial.
pos += afhi_size;
PARA_DEBUG_LOG("size: %zu, chunks start at %d\n", size, pos);
write_u16(buf + AFTROW_CHUNKS_OFFSET_POS, pos);
pos += afhi_size;
PARA_DEBUG_LOG("size: %zu, chunks start at %d\n", size, pos);
write_u16(buf + AFTROW_CHUNKS_OFFSET_POS, pos);
- save_chunk_table(afhi, buf + pos);
+ if (afhi)
+ save_chunk_table(afhi, buf + pos);
PARA_DEBUG_LOG("last byte in buf: %p\n", buf + size - 1);
obj->data = buf;
obj->size = size;
PARA_DEBUG_LOG("last byte in buf: %p\n", buf + size - 1);
obj->data = buf;
obj->size = size;