diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | bufaux.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -89,6 +89,10 @@ | |||
89 | [sshd.c] | 89 | [sshd.c] |
90 | avoid crash at exit: check that pmonitor!=NULL before dereferencing; | 90 | avoid crash at exit: check that pmonitor!=NULL before dereferencing; |
91 | bz#2225, patch from kavi AT juniper.net | 91 | bz#2225, patch from kavi AT juniper.net |
92 | - djm@cvs.openbsd.org 2014/04/16 23:22:45 | ||
93 | [bufaux.c] | ||
94 | skip leading zero bytes in buffer_put_bignum2_from_string(); | ||
95 | reported by jan AT mojzis.com; ok markus@ | ||
92 | 96 | ||
93 | 20140401 | 97 | 20140401 |
94 | - (djm) On platforms that support it, use prctl() to prevent sftp-server | 98 | - (djm) On platforms that support it, use prctl() to prevent sftp-server |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */ | 1 | /* $OpenBSD: bufaux.c,v 1.57 2014/04/16 23:22:45 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 |
@@ -372,6 +372,9 @@ buffer_put_bignum2_from_string(Buffer *buffer, const u_char *s, u_int l) | |||
372 | 372 | ||
373 | if (l > 8 * 1024) | 373 | if (l > 8 * 1024) |
374 | fatal("%s: length %u too long", __func__, l); | 374 | fatal("%s: length %u too long", __func__, l); |
375 | /* Skip leading zero bytes */ | ||
376 | for (; l > 0 && *s == 0; l--, s++) | ||
377 | ; | ||
375 | p = buf = xmalloc(l + 1); | 378 | p = buf = xmalloc(l + 1); |
376 | /* | 379 | /* |
377 | * If most significant bit is set then prepend a zero byte to | 380 | * If most significant bit is set then prepend a zero byte to |