Skip to content
Snippets Groups Projects
Commit 495f781f authored by Tomas Hoger's avatar Tomas Hoger
Browse files

Fix agerr() format string issue in chkNum()

Commit 99eda421 fixed agerr() format string issue in yyerror(), but the
same fix is also needed for chkNum().  In chkNum(), format string can be
injected at least via malicious file name:

  $ cat fs4-%n%s%s%s%s%s%s.dot
  graph G { a [ weight = 0g ] }

  $ dot fs4-%n%s%s%s%s%s%s.dot
  Warning: *** %n in writable segment detected ***
  Aborted
parent 31158b1b
No related branches found
No related tags found
Loading
......@@ -165,7 +165,7 @@ static int chkNum(void) {
agxbput(&xb,buf);
agxbput(&xb,fname);
agxbput(&xb, " splits into two tokens\n");
agerr(AGWARN,agxbuse(&xb));
agerr(AGWARN, "%s", agxbuse(&xb));
agxbfree(&xb);
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment