Add a patch from the bidwatcher home page which avoid segfaults while

bidwatcher is parsing auction data. Bump package revision.
This commit is contained in:
tron 2004-07-20 13:59:12 +00:00
parent bda513561f
commit 9dd2f84b89
3 changed files with 35 additions and 7 deletions

View file

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.37 2004/05/09 09:29:32 jmmv Exp $
# $NetBSD: Makefile,v 1.38 2004/07/20 13:59:12 tron Exp $
DISTNAME= bidwatcher-1.3.15
PKGREVISION= 1
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=bidwatcher/}

View file

@ -1,5 +1,5 @@
$NetBSD: distinfo,v 1.30 2004/05/09 09:29:32 jmmv Exp $
$NetBSD: distinfo,v 1.31 2004/07/20 13:59:12 tron Exp $
SHA1 (bidwatcher-1.3.15.tar.gz) = 96ab2167b7ab1710969c4b6f7b28766de76a9f82
Size (bidwatcher-1.3.15.tar.gz) = 178532 bytes
SHA1 (patch-ac) = ff37c64771f09b40b82f744420e2f1af43d9e37b
SHA1 (patch-ac) = eafc0e9b2626c6b8680a594353f83523959b5573

View file

@ -1,8 +1,35 @@
$NetBSD: patch-ac,v 1.10 2003/08/30 22:17:31 tron Exp $
$NetBSD: patch-ac,v 1.11 2004/07/20 13:59:12 tron Exp $
--- helpers.cpp 17 Jul 2003 04:41:59 -0000 1.90
+++ helpers.cpp 4 Aug 2003 04:22:05 -0000
@@ -513,7 +513,8 @@
--- helpers.cpp.orig 2004-04-23 22:23:28.000000000 +0200
+++ helpers.cpp 2004-07-20 15:48:50.000000000 +0200
@@ -319,7 +319,25 @@
// strip the html tags
for (u = 0; u < buffLength; u++) {
c = stringToStrip[u];
- if (c == '<') IncludeFlag=5;
+ if (u+7<buffLength &&
+ ( 0 == strncmp(&stringToStrip[u],"<script",7) ||
+ 0 == strncmp(&stringToStrip[u],"<SCRIPT",7) ) )
+ IncludeFlag = 6;
+ else if (u+8<buffLength &&
+ ( 0 == strncmp(&stringToStrip[u],"</script",8) ||
+ 0 == strncmp(&stringToStrip[u],"</SCRIPT",8) ) )
+ IncludeFlag = 5;
+ else if (IncludeFlag == 6 && (c == '>' || c == '<') )
+ IncludeFlag = 6;
+ else if (c == '<') {
+ IncludeFlag=5;
+ if (u+4<buffLength &&
+ ( 0 == strncmp(&stringToStrip[u],"<br",3)
+ || 0 == strncmp(&stringToStrip[u],"<td",3)
+ || 0 == strncmp(&stringToStrip[u],"<tr",3) )
+ && Buff[BuffIdx-1] != '\n' )
+ Buff[BuffIdx++] = '\n';
+ }
else if (c == '>') IncludeFlag=10;
else if (IncludeFlag==10) {
if ((BuffIdx > 0) && (c == ' ') &&
@@ -530,7 +548,8 @@
return PB_OUTBID;
else if (strstr(Buff, "You have been outbid"))
return PB_OUTBID;