* src/ftp-ls.c (ftp_parse_winnt_ls): Fix integer overflow

This commit is contained in:
Tim Rühsen 2018-04-24 11:11:47 +02:00
parent 79c1f333dc
commit 7ee3ad1c48

View File

@ -443,8 +443,8 @@ ftp_parse_winnt_ls (FILE *fp)
january will be assumed. */
tok = strtok(line, "-");
if (tok == NULL) continue;
month = atoi(tok) - 1;
if (month < 0) month = 0;
month = atoi(tok);
if (month < 0) month = 0; else month--;
tok = strtok(NULL, "-");
if (tok == NULL) continue;
day = atoi(tok);