Working on MP build (now can run, just crashes due to CPUs treading on each other...
[tpg/acess2.git] / Kernel / messages.c
index c5e14c9..32e579b 100644 (file)
@@ -3,7 +3,7 @@
  * messages.c
  */
 #include <acess.h>
-#include <proc.h>
+#include <threads.h>
 #include <errno.h>
 
 // === CODE ===
@@ -94,7 +94,15 @@ int Proc_GetMessage(Uint *Err, Uint *Source, void *Buffer)
        
        // Get message
        if(Buffer != GETMSG_IGNORE)
+       {
+               if( !CheckMem( Buffer, cur->Messages->Length ) )
+               {
+                       *Err = -EINVAL;
+                       RELEASE( &cur->IsLocked );
+                       return -1;
+               }
                memcpy(Buffer, cur->Messages->Data, cur->Messages->Length);
+       }
        ret = cur->Messages->Length;
        
        // Remove from list

UCC git Repository :: git.ucc.asn.au