Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-03-24 12:06:50 +0300
committerCorinna Vinschen <corinna@vinschen.de>2016-03-24 12:06:50 +0300
commit08fdddea3d2a170f5476ad296d9b73bcf2948471 (patch)
treecb5f48ba09adf27a8e500b4728b8be9298e45271 /newlib
parentb9bbe1bccb1254ce891fc92961be2ec3cd3f6e4a (diff)
Fix coverity CID 143502: Null pointer dereference
* libc/locale/ldpart.c (split_lines): Don't dereference result of strchr without checking for NULL pointer first. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/locale/ldpart.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/locale/ldpart.c b/newlib/libc/locale/ldpart.c
index 35ad3bd13..27900c289 100644
--- a/newlib/libc/locale/ldpart.c
+++ b/newlib/libc/locale/ldpart.c
@@ -175,6 +175,8 @@ split_lines(char *p, const char *plim) {
for (i = 0; p < plim; i++) {
p = strchr(p, '\n');
+ if (!p)
+ break;
*p++ = '\0';
}
return i;