2010-06-22 Jb Evain <jbevain@novell.com>
authorJb Evain <jbevain@gmail.com>
Tue, 22 Jun 2010 09:13:08 +0000 (09:13 -0000)
committerJb Evain <jbevain@gmail.com>
Tue, 22 Jun 2010 09:13:08 +0000 (09:13 -0000)
* Guid.cs: properly throw if the parsed guid has more data after
parsing a correct guid. Fixes #616050.

svn path=/trunk/mcs/; revision=159319

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Guid.cs

index 635b1e557ca096ed1c92f11f3c13fa8a77801b09..2ee3b9933e4875485c9cf61645b01559be98e834 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-22  Jb Evain  <jbevain@novell.com>
+
+       * Guid.cs: properly throw if the parsed guid has more data after
+       parsing a correct guid. Fixes #616050.
+
 2010-06-21 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * Environment.cs: bump up corlib version.
index 8c25d984c15bb84dddf5d0675c183da0e1018040..4541c46463abb595df0ba7d1807ba4fc6b434710 100644 (file)
@@ -153,6 +153,9 @@ namespace System {
                                if (format == Format.P && !ParseChar (')'))
                                        return false;
 
+                               if (!Eof)
+                                       return false;
+
                                guid = new Guid ((int) a, (short) b, (short) c, d);
                                return true;
                        }
@@ -193,6 +196,9 @@ namespace System {
                                if (!(ParseChar ('}') && ParseChar ('}')))
                                        return false;
 
+                               if (!Eof)
+                                       return false;
+
                                guid = new Guid ((int) a, (short) b, (short) c, d);
                                return true;
                        }