From 73e157e0c0543973eb6f296641c9c23b9648ea34 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Fri, 8 Jun 2012 13:48:05 +0000 Subject: [PATCH] add a check for stupids git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@71851 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 3 +++ src/lib/eina_str.c | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7e674e0..42f2f94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -293,3 +293,6 @@ Fix bug in the XML parser when a tag was in a comment or a cdata +2012-06-08 Mike Blumenkrantz + + * Prevent negative max_token count for eina_str_split functions diff --git a/src/lib/eina_str.c b/src/lib/eina_str.c index 8d27c65..e73d8a9 100644 --- a/src/lib/eina_str.c +++ b/src/lib/eina_str.c @@ -76,6 +76,7 @@ eina_str_split_full_helper(const char *str, size_t len, dlen; unsigned int tokens; + EINA_SAFETY_ON_TRUE_RETURN_VAL(max_tokens < 1, NULL); dlen = strlen(delim); if (dlen == 0) { -- 2.7.4