fixes out of bounds write in tar.c

Wed, 30 May 2018 10:27:44 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 30 May 2018 10:27:44 +0200
changeset 385
85d5049f694b
parent 384
8bfde5687890
child 386
99193580aa9d

fixes out of bounds write in tar.c

dav/tar.c file | annotate | diff | comparison | revisions
--- a/dav/tar.c	Wed May 30 10:22:33 2018 +0200
+++ b/dav/tar.c	Wed May 30 10:27:44 2018 +0200
@@ -96,8 +96,9 @@
     snprintf(h.mode, 8, "%07o", mode);
     h.mode[7] = ' ';
     // uid/gid
-    memset(h.uid, '0', 16);
+    memset(h.uid, '0', 8);
     h.uid[7] = ' ';
+    memset(h.gid, '0', 8);
     h.gid[7] = ' ';
     // size
     snprintf(h.size, 12, "%011lo", size);

mercurial