summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2010-03-26 03:13:18 +0000
committerDamien Miller <djm@cvs.openbsd.org>2010-03-26 03:13:18 +0000
commite33e8465ab87ecab6f608176d8bd3616367543d8 (patch)
treea04df346d330e00acdb70b48a5a26bb1ef604c04 /usr.bin/ssh
parent2b1553d25413dd764b0f255c4ed199e24adb53ef (diff)
allow buffer_get_int_ret/buffer_get_int64_ret to take a NULL pointer
argument to allow skipping past values in a buffer
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/bufaux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/bufaux.c b/usr.bin/ssh/bufaux.c
index 936e793103c..8a889611714 100644
--- a/usr.bin/ssh/bufaux.c
+++ b/usr.bin/ssh/bufaux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bufaux.c,v 1.48 2010/02/02 22:49:34 djm Exp $ */
+/* $OpenBSD: bufaux.c,v 1.49 2010/03/26 03:13:17 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -82,7 +82,8 @@ buffer_get_int_ret(u_int *ret, Buffer *buffer)
if (buffer_get_ret(buffer, (char *) buf, 4) == -1)
return (-1);
- *ret = get_u32(buf);
+ if (ret != NULL)
+ *ret = get_u32(buf);
return (0);
}
@@ -104,7 +105,8 @@ buffer_get_int64_ret(u_int64_t *ret, Buffer *buffer)
if (buffer_get_ret(buffer, (char *) buf, 8) == -1)
return (-1);
- *ret = get_u64(buf);
+ if (ret != NULL)
+ *ret = get_u64(buf);
return (0);
}