]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: ensure the buffer passed to file_lines_parse() is 0-terminated
authorRalph Boehme <slow@samba.org>
Thu, 6 Aug 2020 10:55:33 +0000 (12:55 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 2 Oct 2020 19:39:43 +0000 (19:39 +0000)
Otherwise valgrind complains...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index 451b07d686b0d6fb15cb00593e3ad89f82a6486f..8340a8781233af8540ecf2a4881d8ce73b3930d9 100644 (file)
@@ -4755,7 +4755,9 @@ static bool fruit_get_bandsize(vfs_handle_struct *handle,
                goto out;
        }
 
-       file_data = talloc_array(talloc_tos(), uint8_t, plist_file_size);
+       file_data = talloc_zero_array(talloc_tos(),
+                                     uint8_t,
+                                     plist_file_size + 1);
        if (file_data == NULL) {
                ok = false;
                goto out;