components/graphviz/patches/001-d266bb2-buffer-overflow.patch
author Yiteng Zhang <yiteng.zhang@oracle.com>
Wed, 03 Aug 2016 15:33:19 -0700
changeset 6544 f3ddf1d33382
permissions -rw-r--r--
21465165 problem in UTILITY/GRAPHVIZ

From d266bb2b4154d11c27252b56d86963aef4434750 Mon Sep 17 00:00:00 2001
From: "Emden R. Gansner" <[email protected]>
Date: Tue, 7 Jan 2014 10:45:36 -0500
Subject: [PATCH] Prevent possible buffer overflow in yyerror()

---
 lib/cgraph/scan.l | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/cgraph/scan.l b/lib/cgraph/scan.l
index 3efe1d5..212967c 100644
--- a/lib/cgraph/scan.l
+++ b/lib/cgraph/scan.l
@@ -201,7 +201,8 @@ void yyerror(char *str)
 		agxbput (&xb, InputFile);
 		agxbput (&xb, ": ");
 	}
-	sprintf(buf," %s in line %d near '", str,line_num);
+	agxbput (&xb, str);
+	sprintf(buf," in line %d near '", line_num);
 	agxbput (&xb, buf);
 	agxbput (&xb, yytext);
 	agxbput (&xb,"'\n");