[vlc-commits] vlc_strcasestr(): fix infinite loop an invalid haystack

Rémi Denis-Courmont git at videolan.org
Sun Mar 25 17:47:51 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar 25 18:46:47 2012 +0300| [baada5eddfe86431037950fda5c27812ea9dacca] | committer: Rémi Denis-Courmont

vlc_strcasestr(): fix infinite loop an invalid haystack

Pointed-out-by: Edward Wang <edward.c.wang at compdigitec.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=baada5eddfe86431037950fda5c27812ea9dacca
---

 src/text/unicode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/text/unicode.c b/src/text/unicode.c
index 789d0a1..c6b0669 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -237,7 +237,7 @@ char *vlc_strcasestr (const char *haystack, const char *needle)
         s = vlc_towc (haystack, &(uint32_t) { 0 });
         haystack += s;
     }
-    while (s != 0);
+    while (s > 0);
 
     return NULL;
 }



More information about the vlc-commits mailing list