[ros-diffs] [turner] 20051: Check to make sure pointer isnt null after allocation. Fixes bug 1103.

turner at svn.reactos.com turner at svn.reactos.com
Sun Dec 11 06:49:06 CET 2005


Check to make sure pointer isnt null after allocation. Fixes bug 1103.
Modified: trunk/reactos/lib/kernel32/misc/errormsg.c
  _____  

Modified: trunk/reactos/lib/kernel32/misc/errormsg.c
--- trunk/reactos/lib/kernel32/misc/errormsg.c	2005-12-11 05:34:11 UTC
(rev 20050)
+++ trunk/reactos/lib/kernel32/misc/errormsg.c	2005-12-11 05:49:02 UTC
(rev 20051)
@@ -177,6 +177,10 @@

     if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
     {
         from = HeapAlloc( GetProcessHeap(), 0,
strlen((LPCSTR)lpSource)+1 );
+        if (form == NULL)
+        {
+            return 0;
+        }
         strcpy( from, (LPCSTR)lpSource );
     }
     else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051211/ef62594b/attachment.html


More information about the Ros-diffs mailing list