зеркало из https://github.com/github/putty.git
Fix typo in validate_manual_hostkey().
'p += strcspn' returns p always non-NULL and sometimes pointing at \0, as opposed to 'p = strchr' which returns p sometimes non-NULL and never pointing at \0. Test the pointer after the call accordingly. Thanks, Coverity.
This commit is contained in:
Родитель
063c438fec
Коммит
2ef23bb812
2
misc.c
2
misc.c
|
@ -943,7 +943,7 @@ int validate_manual_hostkey(char *key)
|
|||
while ((p += strspn(p, " \t"))[0]) {
|
||||
q = p;
|
||||
p += strcspn(p, " \t");
|
||||
if (p) *p++ = '\0';
|
||||
if (*p) *p++ = '\0';
|
||||
|
||||
/*
|
||||
* Now q is our word.
|
||||
|
|
Загрузка…
Ссылка в новой задаче