dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/engine lib_reflect.c,1.35,1.36


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine lib_reflect.c,1.35,1.36
Date: Mon, 05 May 2003 02:28:15 -0400

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv4771/engine

Modified Files:
        lib_reflect.c 
Log Message:
Fix segfault by ensuring NUL terminated strings.


Index: lib_reflect.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_reflect.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** lib_reflect.c       5 May 2003 03:51:27 -0000       1.35
--- lib_reflect.c       5 May 2003 06:28:12 -0000       1.36
***************
*** 122,125 ****
--- 122,126 ----
        ILType *systemType=ILExecThreadLookupType(thread,"oSystem.Type");
        ILClass *classInfo;
+       char *copyStr;
        
        if(serialType!=ILSerializeGetType(type))
***************
*** 174,178 ****
                                                return NULL;
                                        }
!                                       classInfo = 
ILExecThreadLookupClass(thread,strValue);
                                        if(!classInfo)
                                        {
--- 175,184 ----
                                                return NULL;
                                        }
!                                       /* NOTE: Make sure the string used for 
lookup is NULL
!                                        * terminated */
!                                       copyStr=(char*) 
ILCalloc(strLen+1,sizeof(char));
!                                       ILMemCpy(copyStr,strValue,strLen);
!                                       classInfo = 
ILExecThreadLookupClass(thread,copyStr);
!                                       ILFree(copyStr);
                                        if(!classInfo)
                                        {
***************
*** 231,235 ****
                                                                return NULL;
                                                        }
!                                                       
classInfo=ILExecThreadLookupClass(thread,strValue);
                                                        if(!classInfo)
                                                        {
--- 237,246 ----
                                                                return NULL;
                                                        }
!                                                       /* NOTE: Make sure the 
string used for lookup 
!                                                        * is NULL terminated */
!                                                       copyStr=(char*) 
ILCalloc(strLen+1,sizeof(char));
!                                                       
ILMemCpy(copyStr,strValue,strLen);
!                                                       classInfo = 
ILExecThreadLookupClass(thread,copyStr);
!                                                       ILFree(copyStr);
                                                        if(!classInfo)
                                                        {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]