[Redbutton-devel] SF.net SVN: redbutton: [166] redbutton-browser/trunk/ResidentProgramClass.c
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-01-07 12:19:40
|
Revision: 166
http://svn.sourceforge.net/redbutton/?rev=166&view=rev
Author: skilvington
Date: 2007-01-07 04:19:37 -0800 (Sun, 07 Jan 2007)
Log Message:
-----------
fail searches outside the range of the string
Modified Paths:
--------------
redbutton-browser/trunk/ResidentProgramClass.c
Modified: redbutton-browser/trunk/ResidentProgramClass.c
===================================================================
--- redbutton-browser/trunk/ResidentProgramClass.c 2007-01-07 11:16:12 UTC (rev 165)
+++ redbutton-browser/trunk/ResidentProgramClass.c 2007-01-07 12:19:37 UTC (rev 166)
@@ -797,8 +797,8 @@
search_substring(OctetString *string, int start, OctetString *search)
{
/* range check */
- start = MAX(start, 1);
- start = MIN(start, string->size);
+ if(start < 1 || start > string->size)
+ return -1;
/* simple cases */
if(string->size == 0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|