Fix several undefined behaviors

This commit is contained in:
Polshakov Dmitry 2016-04-10 00:59:20 +03:00
parent 3b4a411532
commit 29b66b00b7
4 changed files with 32 additions and 7 deletions

View file

@ -177,7 +177,11 @@ int start_imap(int s, char *ip, int port, unsigned char options, char *miscptr,
break;
}
hydra_tobase64((unsigned char *) buffer, strlen(buffer), sizeof(buffer));
sprintf(buffer, "%.250s\r\n", buffer);
char tmp_buffer[sizeof(buffer)];
sprintf(tmp_buffer, "%.250s\r\n", buffer);
strcpy(buffer, tmp_buffer);
free(preplogin);
}
break;