mirror of
https://github.com/curl/curl.git
synced 2026-08-11 17:30:54 +03:00
ftplistparser: add two overflow preventions
These two conditions probably cannot actually happen, but these two checks make that certain and should please the static code analyzers. Pointed out by Coverity Closes #17397
This commit is contained in:
parent
be45e014c6
commit
155af7ac77
1 changed files with 2 additions and 2 deletions
|
|
@ -485,7 +485,7 @@ static CURLcode parse_unix(struct Curl_easy *data,
|
|||
switch(parser->state.UNIX.sub.hlinks) {
|
||||
case PL_UNIX_HLINKS_PRESPACE:
|
||||
if(c != ' ') {
|
||||
if(ISDIGIT(c)) {
|
||||
if(ISDIGIT(c) && len) {
|
||||
parser->item_offset = len - 1;
|
||||
parser->item_length = 1;
|
||||
parser->state.UNIX.sub.hlinks = PL_UNIX_HLINKS_NUMBER;
|
||||
|
|
@ -850,7 +850,7 @@ static CURLcode parse_winnt(struct Curl_easy *data,
|
|||
case PL_WINNT_DIRORSIZE:
|
||||
switch(parser->state.NT.sub.dirorsize) {
|
||||
case PL_WINNT_DIRORSIZE_PRESPACE:
|
||||
if(c != ' ') {
|
||||
if(c != ' ' && len) {
|
||||
parser->item_offset = len - 1;
|
||||
parser->item_length = 1;
|
||||
parser->state.NT.sub.dirorsize = PL_WINNT_DIRORSIZE_CONTENT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue