[PATCH] equipment.c: Fix potential buffer overflow in size_data_funct()

Lubomir I. Ivanov neolit123 at gmail.com
Sun Mar 3 14:12:10 PST 2013


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

strcpy() with buffer[10], could overflow on most languages.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
 equipment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/equipment.c b/equipment.c
index f0a9df4..19add3f 100644
--- a/equipment.c
+++ b/equipment.c
@@ -1336,7 +1336,7 @@ static void size_data_func(GtkTreeViewColumn *col,
 {
 	int ml, mbar;
 	double size, pressure;
-	char buffer[10];
+	char buffer[64];
 
 	gtk_tree_model_get(model, iter, CYL_SIZE, &ml, CYL_WORKP, &mbar, -1);
 	convert_volume_pressure(ml, mbar, &size, &pressure);
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list