BUG: improper format string construction in framework.exp

Jacob Bachmeyer <[email protected]> Sat, 27 Oct 2018 23:48:08 -0500
Newsgroups gmane.comp.sysutils.dejagnu.bugs
Message-ID <[email protected]>
A message that contains a '%' character will cause Tcl to raise an error 
at the format in record_test in lib/framework.exp on line 803 as of 
commit 81651abb04defb181f9c98bfcc55e077dcaea452.  This is a "classic" 
format string vulnerability, except that Tcl catches it and raises an error.

patch:

diff --git a/lib/framework.exp b/lib/framework.exp
index 6cb93c5..9dd0b90 100644
--- a/lib/framework.exp
+++ b/lib/framework.exp
@@ -800,7 +800,7 @@ proc record_test { type message args } {
 
     global multipass_name
     if { $multipass_name != "" } {
-       set message [format "$type: %s: $message" "$multipass_name"]
+       set message [format "$type: %s: %s" "$message" "$multipass_name"]
     } else {
        set message "$type: $message"
     }



-- Jacob