summaryrefslogtreecommitdiff
path: root/bufaux.c
diff options
context:
space:
mode:
Diffstat (limited to 'bufaux.c')
-rw-r--r--bufaux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bufaux.c b/bufaux.c
index 9401fe1d0..e24b5fc0a 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bufaux.c,v 1.54 2014/01/12 08:13:13 djm Exp $ */ 1/* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -216,7 +216,7 @@ buffer_get_cstring_ret(Buffer *buffer, u_int *length_ptr)
216 if (cp == ret + length - 1) 216 if (cp == ret + length - 1)
217 error("buffer_get_cstring_ret: string contains \\0"); 217 error("buffer_get_cstring_ret: string contains \\0");
218 else { 218 else {
219 bzero(ret, length); 219 explicit_bzero(ret, length);
220 free(ret); 220 free(ret);
221 return NULL; 221 return NULL;
222 } 222 }
@@ -346,7 +346,7 @@ buffer_get_bignum2_as_string_ret(Buffer *buffer, u_int *length_ptr)
346 } 346 }
347 ret = xmalloc(len); 347 ret = xmalloc(len);
348 memcpy(ret, p, len); 348 memcpy(ret, p, len);
349 memset(p, '\0', len); 349 explicit_bzero(p, len);
350 free(bin); 350 free(bin);
351 return ret; 351 return ret;
352} 352}
@@ -383,7 +383,7 @@ buffer_put_bignum2_from_string(Buffer *buffer, const u_char *s, u_int l)
383 } 383 }
384 memcpy(p, s, l); 384 memcpy(p, s, l);
385 buffer_put_string(buffer, buf, l + pad); 385 buffer_put_string(buffer, buf, l + pad);
386 memset(buf, '\0', l + pad); 386 explicit_bzero(buf, l + pad);
387 free(buf); 387 free(buf);
388} 388}
389 389