Explorar o código

Allocate one more byte than the size would indicate, since we're
null-terminating.

Paul Eggert %!s(int64=23) %!d(string=hai) anos
pai
achega
e6e72bf7ed
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/list.c

+ 1 - 1
src/list.c

@@ -352,7 +352,7 @@ read_header (bool raw_extended_headers)
 	  set_next_block_after (header);
 	  if (*longp)
 	    free (*longp);
-	  *longp = xmalloc (size);
+	  *longp = xmalloc (size + 1);
 	  **longp = *header;
 	  bp = (*longp)->buffer + BLOCKSIZE;