]> granicus.if.org Git - graphviz/commitdiff
fix buffer overflow in write_nodename()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Oct 2020 17:11:36 +0000 (10:11 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Oct 2020 01:46:51 +0000 (18:46 -0700)
This buffer was not large enough to print the string and uint64_t that gets
written into it. Related to !1620.

lib/cgraph/write.c

index 153832ec8d28a36e38d92b61259ba1405f1dd6ab..caa12db3f3cbe119d13cfbd1213d228237c92b1f 100644 (file)
@@ -497,7 +497,7 @@ static int write_nondefault_attrs(void *obj, iochan_t * ofile,
 
 static int write_nodename(Agnode_t * n, iochan_t * ofile)
 {
-    char *name, buf[20];
+    char *name, buf[sizeof("__SUSPECT") + 20];
     Agraph_t *g;
 
     name = agnameof(n);