Blob Blame History Raw
From 9a95ca5da96846f3edea48ab18c6365001805e70 Mon Sep 17 00:00:00 2001
From: Mike Fleetwood <mike.fleetwood@googlemail.com>
Date: Sun, 28 Feb 2016 15:36:10 +0000
Subject: [PATCH 29/30] lib-fs-resize: Prevent crash resizing FAT with very
 deep directories

Resizing a FAT file system crashes in libparted/fs/r/fat/count.c
flag_traverse_dir() if the length of any path name in the file system
overflows the 512 byte file_name local buffer.  Increase buffer to 4096,
PATH_MAX on Linux.

Reported in
https://bugzilla.gnome.org/show_bug.cgi?id=762448
---
 libparted/fs/r/fat/count.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libparted/fs/r/fat/count.c b/libparted/fs/r/fat/count.c
index 7949e47..a5837c0 100644
--- a/libparted/fs/r/fat/count.c
+++ b/libparted/fs/r/fat/count.c
@@ -219,7 +219,7 @@ flag_traverse_dir (FatTraverseInfo* trav_info) {
 	PedFileSystem*		fs = trav_info->fs;
 	FatDirEntry*		this_entry;
 	FatTraverseInfo*	subdir_trav_info;
-	char			file_name [512];
+	char			file_name [4096];
 	char*			file_name_start;
 	FatCluster		first_cluster;
 	PedSector		size;
-- 
2.5.0