The following patch should clear up this segfault problem.  I've verified it
with my install.

It's strange, but 2.72 razor-agents seem to have incorporated the FreeBSD
ports "patch", however this one they screwed up.  The code as provided will
trample a byte beyond the allocated string...  Since WHEN have you EVER been
able to set any allocated memory location *(ptr+size) to anything?!

A memory block of size N, provides an array of range *ptr through
*ptr+(size-1)...  *(ptr+size) is undefined memory.

End CS 101 Lesson.

=R=

--- deHTMLxs.xs~        2005-06-22 16:57:59.000000000 -0700
+++ deHTMLxs.xs 2005-06-22 16:57:59.000000000 -0700
@@ -112,7 +112,7 @@
             text = SvRV(scalarref);
             raw = SvPV(text,size);
 
-            *(raw + size) = '\0';
+            *(raw + size - 1) = '\0';
             if ( (cleaned = malloc(size+1)) && 
                  (res = html_strip(raw, cleaned))  // html_strip will memset
cleaned to 0
                  ) {



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Razor-users mailing list
Razor-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/razor-users

Reply via email to