mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 01:34:25 +03:00
ensure all vmkpath implementations check their parameters
This commit is contained in:
parent
7ba459f1b5
commit
0a2082d777
@ -262,6 +262,10 @@ static nserror amiga_vmkpath(char **str, size_t *size, size_t nelm, va_list ap)
|
||||
*/
|
||||
for (elm_idx = 0; elm_idx < nelm; elm_idx++) {
|
||||
elm[elm_idx] = va_arg(ap, const char *);
|
||||
/* check the argument is not NULL */
|
||||
if (elm[elm_idx] == NULL) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
elm_len[elm_idx] = strlen(elm[elm_idx]);
|
||||
fname_len += elm_len[elm_idx];
|
||||
}
|
||||
|
@ -2334,6 +2334,10 @@ static nserror riscos_mkpath(char **str, size_t *size, size_t nelm, va_list ap)
|
||||
*/
|
||||
for (elm_idx = 0; elm_idx < nelm; elm_idx++) {
|
||||
elm[elm_idx] = va_arg(ap, const char *);
|
||||
/* check the argument is not NULL */
|
||||
if (elm[elm_idx] == NULL) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
elm_len[elm_idx] = strlen(elm[elm_idx]);
|
||||
fname_len += elm_len[elm_idx];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user