libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] [patch] Handle strings that aren't NULL terminate d


From: Mark Young
Subject: Re: [libunwind] [patch] Handle strings that aren't NULL terminate d
Date: Sat, 19 Jun 2004 10:57:05 -0700

Sorry, yes, the patch did fix the problem.
--Mark

David Mosberger wrote: 

>>>>> On Fri, 18 Jun 2004 14:23:15 -0400, "Ed Connell"  <mailto:address@hidden> 
>>>>> <address@hidden> said: 

  Ed> Intel's icc produces strings that aren't NULL terminated which 
  Ed> causes a crash in libunwind.  Here's a fix. 

I don't see how this could happen.  Do you have a concrete example? 

Note: there was a related/similar bug reported by Mark Young which 
should be fixed by the attached problem (though I never seem to have 
gotten confirmation of that, now that you remind me of it). 

Does the attached patch fix the problem for you? 

Thanks, 

        --david 

===== src/os-linux.h 1.5 vs edited ===== 
--- 1.5/src/os-linux.h  Wed Apr 21 00:24:34 2004 
+++ edited/src/os-linux.h       Wed Jun  9 16:01:47 2004 
@@ -139,9 +139,12 @@ 
  
   while (1) 
     { 
-      digit = *cp++; 
+      digit = *cp; 
       if ((digit - '0') <= 9) 
-       digit -= '0'; 
+       { 
+         digit -= '0'; 
+         ++cp; 
+       } 
       else 
        break; 
       val = (10 * val) + digit; 
@@ -159,7 +162,11 @@ 
   if (!cp) 
     return NULL; 
  
-  *valp = *cp++; 
+  *valp = *cp; 
+ 
+  /* don't step over NUL terminator */ 
+  if (*cp) 
+    ++cp; 
   return cp; 
 } 
  
_______________________________________________ 
libunwind mailing list 
address@hidden <mailto:address@hidden>  
http://www.hpl.hp.com/hosted/linux/mail-archives/libunwind/ 
<http://www.hpl.hp.com/hosted/linux/mail-archives/libunwind/>  




reply via email to

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