summaryrefslogtreecommitdiff
path: root/crypto/openssh/bufaux.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2014-04-20 11:34:33 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2014-04-20 11:34:33 +0000
commit30a0343983a069d8a01c5dda58cede59d0c7d216 (patch)
treec924bd7387ade2fccece4f9941549459346b5111 /crypto/openssh/bufaux.c
parentecb47cf9c5e03d3f0011fd4b9687a87f9808e483 (diff)
parent12459a528f0a5dfa735c6917135c071754daa020 (diff)
downloadsrc-test2-30a0343983a069d8a01c5dda58cede59d0c7d216.tar.gz
src-test2-30a0343983a069d8a01c5dda58cede59d0c7d216.zip
Notes
Diffstat (limited to 'crypto/openssh/bufaux.c')
-rw-r--r--crypto/openssh/bufaux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/openssh/bufaux.c b/crypto/openssh/bufaux.c
index e24b5fc0af4d..f6a6f2ab246a 100644
--- a/crypto/openssh/bufaux.c
+++ b/crypto/openssh/bufaux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */
+/* $OpenBSD: bufaux.c,v 1.57 2014/04/16 23:22:45 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -372,6 +372,9 @@ buffer_put_bignum2_from_string(Buffer *buffer, const u_char *s, u_int l)
if (l > 8 * 1024)
fatal("%s: length %u too long", __func__, l);
+ /* Skip leading zero bytes */
+ for (; l > 0 && *s == 0; l--, s++)
+ ;
p = buf = xmalloc(l + 1);
/*
* If most significant bit is set then prepend a zero byte to