diff options
author | obrien <obrien@FreeBSD.org> | 2003-01-19 02:57:12 +0800 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2003-01-19 02:57:12 +0800 |
commit | 61c7f8c74889c7b46b7ffa3062012046254c3763 (patch) | |
tree | f622605d336dcd1d4412a0bd7b8cb4243538859f /misc/bidwatcher/files | |
parent | 4c57bd7d215936db85ea768f55e41c85a991cd77 (diff) | |
download | freebsd-ports-gnome-61c7f8c74889c7b46b7ffa3062012046254c3763.tar.gz freebsd-ports-gnome-61c7f8c74889c7b46b7ffa3062012046254c3763.tar.zst freebsd-ports-gnome-61c7f8c74889c7b46b7ffa3062012046254c3763.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)
Diffstat (limited to 'misc/bidwatcher/files')
-rw-r--r-- | misc/bidwatcher/files/patch-helpers.cpp | 21 |
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=='<') { |