Don't write out zero-byte sections in builder
authorRyan Lortie <desrt@desrt.ca>
Mon, 19 Apr 2010 14:28:44 +0000 (10:28 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 19 Apr 2010 14:39:54 +0000 (10:39 -0400)
This and the previous issue caught by Christian Persch in bug #616156

gio/gvdb/gvdb-builder.c

index de9fff2..7cca13f 100644 (file)
@@ -236,6 +236,9 @@ file_builder_allocate (FileBuilder         *fb,
 {
   FileChunk *chunk;
 
+  if (size == 0)
+    return NULL;
+
   fb->offset += (-fb->offset) & (alignment - 1);
   chunk = g_slice_new (FileChunk);
   chunk->offset = fb->offset;