[Mono-bugs] [Bug 72908][Cos] New - [GMCS] parser fails on malicious mix of < > (

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 23 Feb 2005 08:17:49 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by nazgul@omega.pl.

http://bugzilla.ximian.com/show_bug.cgi?id=72908

--- shadow/72908	2005-02-23 08:17:49.000000000 -0500
+++ shadow/72908.tmp.7633	2005-02-23 08:17:49.000000000 -0500
@@ -0,0 +1,60 @@
+Bug#: 72908
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: Mandrake 10.1, mono 1.1.4.20040221svn
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: nazgul@omega.pl               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] parser fails on malicious  mix of < > (
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+gmcs parser cannot distinguish between generic <> arguments and < >
+comparison operators
+
+Steps to reproduce the problem:
+1. Try to compile program:
+
+class A { }
+  
+public class B {
+  static int goo <T1, T2, T3, T4, T5> (int d) { return 3; }
+
+  static void foo (int x) { }
+  static void foo (bool h, int x, int y, int j, bool k) { }
+
+  public void Add (object x) { }
+
+  static void Main () {
+    int A = 4;
+    int goo1 = 3;
+    foo (goo <A, A, A, A, A> (1));
+    foo (goo1 <A, A, A, A, A > goo1);
+  }
+}
+
+
+Actual Results:
+syntax error, got token `IDENTIFIER'
+t.cs(20) error CS1002: Expecting `;'
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:
+Compilation succeeded.
+
+How often does this happen? 
+Always
+
+Additional Information:
+csc beta1 handles it ok