Skip to content

Commit

Permalink
polarassl: avoid memset() when clearing the first byte is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Sep 8, 2014
1 parent af45542 commit 921a0c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vtls/polarssl.c
Expand Up @@ -148,7 +148,7 @@ polarssl_connect_step1(struct connectdata *conn,
void *old_session = NULL;
size_t old_session_size = 0;
char errorbuf[128];
memset(errorbuf, 0, sizeof(errorbuf));
errorbuf[0]=0;

/* PolarSSL only supports SSLv3 and TLSv1 */
if(data->set.ssl.version == CURL_SSLVERSION_SSLv2) {
Expand Down Expand Up @@ -380,7 +380,7 @@ polarssl_connect_step2(struct connectdata *conn,
#endif

char errorbuf[128];
memset(errorbuf, 0, sizeof(errorbuf));
errorbuf[0] = 0;

conn->recv[sockindex] = polarssl_recv;
conn->send[sockindex] = polarssl_send;
Expand Down

0 comments on commit 921a0c2

Please sign in to comment.