aboutsummaryrefslogtreecommitdiff
path: root/misc/bidwatcher
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2003-01-18 18:57:12 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2003-01-18 18:57:12 +0000
commitdfa2b6e621a6470133c1639f51b32d8c17bb9a7d (patch)
tree96a38a891fbdc5e03f2c06ccd7dcadf80def5312 /misc/bidwatcher
parent5bff24714757de3b6666690fee924e27d7a8450d (diff)
downloadports-dfa2b6e621a6470133c1639f51b32d8c17bb9a7d.tar.gz
ports-dfa2b6e621a6470133c1639f51b32d8c17bb9a7d.zip
StripAndTab() poorly designed for "". It is possible for it to get
called on a zero length string and the code assumes this is not possible. Reviewed by: Kevin Dwyer <kevindication> (Bidwatcher author)
Notes
Notes: svn path=/head/; revision=73418
Diffstat (limited to 'misc/bidwatcher')
-rw-r--r--misc/bidwatcher/files/patch-helpers.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/misc/bidwatcher/files/patch-helpers.cpp b/misc/bidwatcher/files/patch-helpers.cpp
new file mode 100644
index 000000000000..525eff1e2e7e
--- /dev/null
+++ b/misc/bidwatcher/files/patch-helpers.cpp
@@ -0,0 +1,21 @@
+--- helpers.cpp.orig Sat Dec 21 00:00:42 2002
++++ helpers.cpp Sun Dec 29 09:31:01 2002
+@@ -344,13 +344,16 @@
+ //////////////////////////////////////////////////////////////////////
+ char * StripAndTab(const char * stringToStrip)
+ {
+- char *Buff=(char *)malloc(strlen(stringToStrip));
+- Buff[0]='\0';
+ int buffLength = strlen(stringToStrip);
+ int BuffIdx = 0;
+ int u,c;
+ int IncludeFlag = 5;
+ bool tabFlag = FALSE;
++ if (!buffLength) {
++ ++buffLength; // some malloc's don't handled malloc(0) well
++ }
++ char *Buff=(char *)malloc(buffLength);
++ Buff[0]='\0';
+ for (u = 0; (u < buffLength);u++) {
+ c = stringToStrip[u];
+ if (c=='<') {