diff --git a/qubes-rpc/tar2qfile.c b/qubes-rpc/tar2qfile.c index 4762a2b..d508a1f 100644 --- a/qubes-rpc/tar2qfile.c +++ b/qubes-rpc/tar2qfile.c @@ -756,7 +756,7 @@ ustar_rd (int fd, struct file_header * untrusted_hdr, char *buf, struct stat * s #ifdef DEBUG fprintf(stderr,"Inserting %s into register\n",path); #endif - dirs_headers_sent = realloc(dirs_headers_sent, sizeof (char*) * n_dirs++); + dirs_headers_sent = realloc(dirs_headers_sent, sizeof (char*) * (++n_dirs)); if (dirs_headers_sent == NULL) return MEMORY_ALLOC_FAILED; dirs_headers_sent[n_dirs-1] = malloc(sizeof (char) * (strlen(path)+1));