PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Sun Nov 11 14:12:13 PST 2007


 src/kit/kit-string.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 29837b4a034e7bf1fe1bc6b82cc7314317c05abe
Author: David Zeuthen <davidz at redhat.com>
Date:   Sun Nov 11 17:08:38 2007 -0500

    don't overflow when splitting a string

diff --git a/src/kit/kit-string.c b/src/kit/kit-string.c
index 75b7009..a3d4037 100644
--- a/src/kit/kit-string.c
+++ b/src/kit/kit-string.c
@@ -269,8 +269,9 @@ kit_strsplit (const char *s, char delim, size_t *num_tokens)
 
                 begin = m;
 
-                while (s[m] != delim)
+                while (s[m] != delim && s[m] != '\0') {
                         m++;
+                }
 
                 result[n] = kit_strndup (s + begin, m - begin);
                 if (result[n] == NULL)


More information about the hal-commit mailing list