mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
misc.c: in cm_mbchar check string!=NULL before dereferencing it
This commit is contained in:
parent
512269a330
commit
c3fa950f8f
1 changed files with 2 additions and 2 deletions
|
@ -639,7 +639,7 @@ cm_mbchar(char *str) {
|
||||||
free(buf);
|
free(buf);
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
}
|
}
|
||||||
if ( *string == '\0' ) {
|
if ( string != NULL && *string == '\0' ) {
|
||||||
free(string_head);
|
free(string_head);
|
||||||
string_head = NULL;
|
string_head = NULL;
|
||||||
string = NULL;
|
string = NULL;
|
||||||
|
@ -652,7 +652,7 @@ cm_mbchar(char *str) {
|
||||||
string += num_byte;
|
string += num_byte;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue