mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
name.c: fix possible crash in attstore()
From OpenSUSE:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-env.dif
(the init.c fix there is already done differently in 3654ee73
)
src/cmd/ksh93/sh/name.c: attstore():
- Check nv_mapchar() returns a non-null pointer before using it.
This commit is contained in:
parent
cc4927529b
commit
3ad4307054
1 changed files with 1 additions and 1 deletions
|
@ -2113,7 +2113,7 @@ static void attstore(register Namval_t *np, void *data)
|
||||||
if((flag&(NV_UTOL|NV_LTOU|NV_INTEGER)) == (NV_UTOL|NV_LTOU))
|
if((flag&(NV_UTOL|NV_LTOU|NV_INTEGER)) == (NV_UTOL|NV_LTOU))
|
||||||
{
|
{
|
||||||
data = (void*)nv_mapchar(np,0);
|
data = (void*)nv_mapchar(np,0);
|
||||||
if(strcmp(data,e_tolower) && strcmp(data,e_toupper))
|
if(data && strcmp(data,e_tolower) && strcmp(data,e_toupper))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
flag &= (NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER);
|
flag &= (NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER);
|
||||||
|
|
Loading…
Reference in a new issue