diff options
Diffstat (limited to 'bufaux.c')
-rw-r--r-- | bufaux.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bufaux.c,v 1.47 2010/01/12 01:36:08 djm Exp $ */ | 1 | /* $OpenBSD: bufaux.c,v 1.48 2010/02/02 22:49:34 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 |
@@ -166,7 +166,10 @@ buffer_get_string_ret(Buffer *buffer, u_int *length_ptr) | |||
166 | u_int len; | 166 | u_int len; |
167 | 167 | ||
168 | /* Get the length. */ | 168 | /* Get the length. */ |
169 | len = buffer_get_int(buffer); | 169 | if (buffer_get_int_ret(&len, buffer) != 0) { |
170 | error("buffer_get_string_ret: cannot extract length"); | ||
171 | return (NULL); | ||
172 | } | ||
170 | if (len > 256 * 1024) { | 173 | if (len > 256 * 1024) { |
171 | error("buffer_get_string_ret: bad string length %u", len); | 174 | error("buffer_get_string_ret: bad string length %u", len); |
172 | return (NULL); | 175 | return (NULL); |