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>
This commit is contained in:
Corinna Vinschen 2016-03-24 10:06:50 +01:00
parent b9bbe1bccb
commit 08fdddea3d
1 changed files with 2 additions and 0 deletions

View File

@ -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;