[mono/gtk-sharp] [2 commits] cfdbb3b9: glib: fix IntPtr.Zero being dereferenced in GLib.Value.ToBoxed()

"Bertrand Lorentz ([email protected])" <[email protected]> Sat, 9 Nov 2013 16:10:45 +0000
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <000001423da1376e-756038a2-718d-4373-9927-108f5a097ba5-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/gtk-sharp
  Compare: https://github.com/mono/gtk-sharp/compare/e48ac63d54c4...859832f6e4b6

   Commit: cfdbb3b9a7c644128517f24fb5224b299ffb064f
   Author: Stephan Sundermann <[email protected]> (xDarkice)
Committer: AndrĂ©s G. Aragoneses <[email protected]> (knocte)
     Date: 2013-11-02 15:52:25 GMT
      URL: https://github.com/mono/gtk-sharp/commit/cfdbb3b9a7c644128517f24fb5224b299ffb064f

glib: fix IntPtr.Zero being dereferenced in GLib.Value.ToBoxed()

Changed paths:
  M glib/Value.cs

Modified: glib/Value.cs
===================================================================
@@ -414,6 +414,10 @@ object ToEnum ()
 		object ToBoxed ()
 		{
 			IntPtr boxed_ptr = g_value_get_boxed (ref this);
+
+			if (boxed_ptr == IntPtr.Zero)
+				return null;
+
 			Type t = GType.LookupType (type);
 			if (t == null)
 				throw new Exception ("Unknown type " + new GType (type).ToString ());

   Commit: 859832f6e4b6bda36ff3f8819c82231871c36e76
   Author: Bertrand Lorentz <[email protected]> (bl8)
     Date: 2013-11-09 16:08:40 GMT
      URL: https://github.com/mono/gtk-sharp/commit/859832f6e4b6bda36ff3f8819c82231871c36e76

Merge pull request #89 from knocte/master

glib: fix IntPtr.Zero being dereferenced in GLib.Value.ToBoxed()

Changed paths:
  M glib/Value.cs

Modified: glib/Value.cs
===================================================================
@@ -414,6 +414,10 @@ object ToEnum ()
 		object ToBoxed ()
 		{
 			IntPtr boxed_ptr = g_value_get_boxed (ref this);
+
+			if (boxed_ptr == IntPtr.Zero)
+				return null;
+
 			Type t = GType.LookupType (type);
 			if (t == null)
 				throw new Exception ("Unknown type " + new GType (type).ToString ());
_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches