The su-filter.pl script used for code reformatting in OpenSSL 1.0.1p has a 
regex that is looking for the start of a struct or union definition.  It is 
supposed to match code similar to the following:
struct identifier {

However, to match the identifier it is using [^\s]+ which also matches 
characters that are not valid in identifiers.  For example, it will also match 
code similar to the following.  This can result in the rest of the file being 
truncated.
if (foo = OPENSSL_malloc(sizeof(struct identifier))) {

One possible fix is attached.

Wesley Ellinger
HP


--- prev/su-filter.pl   2015-03-19 09:02:02.000000000 -0500
+++ su-filter.pl        2015-10-02 15:11:11.815000953 -0500
@@ -47,7 +47,7 @@
             do_output($out);
             $in_su = 0;
         }
-    } elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ 
)?\{/) {
+    } elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) 
([0-9a-zA-Z_]+ )?\{/) {
         $in_su = 1;
         $indent = $1;
         $out = $_;
_______________________________________________
openssl-bugs-mod mailing list
[email protected]
https://mta.openssl.org/mailman/listinfo/openssl-bugs-mod
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to