eina: eina_unicode_utf8_next_get should return 0
authorJaeun Choi <jaeun12.choi@samsung.com>
Wed, 8 Apr 2015 12:29:13 +0000 (21:29 +0900)
committerJaeun Choi <jaeun12.choi@samsung.com>
Wed, 8 Apr 2015 12:29:13 +0000 (21:29 +0900)
when one of the parameters is NULL to avoid null pointer access.
it also corresponds to the description in doc.

@fix

src/lib/eina/eina_inline_unicode.x

index cf9a993..572fc05 100644 (file)
@@ -35,6 +35,8 @@ eina_unicode_utf8_next_get(const char *buf, int *iindex)
    Eina_Unicode r;
    unsigned char d;
 
+   if (!buf || !iindex) return 0;
+
    ind = *iindex;
 
    /* if this char is the null terminator, exit */