]> arthur.barton.de Git - netatalk.git/commitdiff
afpd/directory: avoid unitialized pointer read
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Mon, 11 Feb 2013 21:35:21 +0000 (22:35 +0100)
committerRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Mon, 11 Feb 2013 21:35:21 +0000 (22:35 +0100)
Initialize fullpath to null so that in case of error before its
allocation we don't call bdestroy on random memory.

Reported by Coverity as CID #201284.

etc/afpd/directory.c

index 9a4fc64e5d6704cc132f9e5125c97a0b71b7afbd..eb1cdf581285171df9cfb090e5c9b1cd3e8d1907 100644 (file)
@@ -815,7 +815,7 @@ struct dir *dir_add(struct vol *vol, const struct dir *dir, struct path *path, i
     cnid_t      id;
     struct adouble  ad;
     struct adouble *adp = NULL;
-    bstring fullpath;
+    bstring fullpath = NULL;
 
     AFP_ASSERT(vol);
     AFP_ASSERT(dir);