[Mono-bugs] [Bug 662994] NullReferenceException in String.memcpy2 when calling Marshal.PtrToStructure with invalid pointer

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 7 13:59:59 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=662994

https://bugzilla.novell.com/show_bug.cgi?id=662994#c3


Eric Zeitler <eric.zeitler at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eric.zeitler at gmail.com

--- Comment #3 from Eric Zeitler <eric.zeitler at gmail.com> 2011-01-07 18:59:58 UTC ---
(In reply to comment #2)
> I understand that, I don't see actual code behind. I couldn't understand why
> NullReferenceException is thrown. Maybe we should check something for null and
> throw something other than NullReferenceException. That is the point I want to
> mention.

The NullReferenceException may be a legacy artifact from .Net 1.0/1.1 where any
bad-pointer threw a NullReferenceException; in .Net 2.0 this was changed to an
AccessViolationException.  This newer exception can be thrown at any time
during execution (like ExecutionEngineException and OutOfMemoryException) so
doesn't need to be part of any method/class documentation.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list