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

@ -205,7 +205,10 @@ int start_pop3(int s, char *ip, int port, unsigned char options, char *miscptr,
memset(buffer, 0, sizeof(buffer));
sasl_plain(buffer, login, pass);
sprintf(buffer, "%.250s\r\n", buffer);
char tmp_buffer[sizeof(buffer)];
sprintf(tmp_buffer, "%.250s\r\n", buffer);
strcpy(buffer, tmp_buffer);
}
break;
@ -279,7 +282,10 @@ int start_pop3(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;