summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-03-18 17:25:30 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-03-18 17:25:30 +0000
commit89a48e3d5c29f676d27fba0b46f9a439794862fd (patch)
tree57e7f5195e5243efab8d7102109550a62909f0ed /usr.bin/ssh
parent8c8b1c51a8e0c6d24c95ec17c8c1e04e2ecb5390 (diff)
buffer_skip_string and extra sanity checking; needed by ssh-privsep
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/bufaux.c4
-rw-r--r--usr.bin/ssh/bufaux.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/ssh/bufaux.c b/usr.bin/ssh/bufaux.c
index 0c92ed9d648..e489038d853 100644
--- a/usr.bin/ssh/bufaux.c
+++ b/usr.bin/ssh/bufaux.c
@@ -37,7 +37,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: bufaux.c,v 1.22 2002/01/18 18:14:17 stevesk Exp $");
+RCSID("$OpenBSD: bufaux.c,v 1.23 2002/03/18 17:25:29 provos Exp $");
#include <openssl/bn.h>
#include "bufaux.h"
@@ -217,6 +217,8 @@ buffer_put_string(Buffer *buffer, const void *buf, u_int len)
void
buffer_put_cstring(Buffer *buffer, const char *s)
{
+ if (s == NULL)
+ fatal("buffer_put_cstring: s == NULL");
buffer_put_string(buffer, s, strlen(s));
}
diff --git a/usr.bin/ssh/bufaux.h b/usr.bin/ssh/bufaux.h
index fda41caaa5f..44592076f96 100644
--- a/usr.bin/ssh/bufaux.h
+++ b/usr.bin/ssh/bufaux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bufaux.h,v 1.16 2002/03/04 17:27:39 stevesk Exp $ */
+/* $OpenBSD: bufaux.h,v 1.17 2002/03/18 17:25:29 provos Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -36,4 +36,7 @@ void *buffer_get_string(Buffer *, u_int *);
void buffer_put_string(Buffer *, const void *, u_int);
void buffer_put_cstring(Buffer *, const char *);
+#define buffer_skip_string(b) \
+ do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while(0)
+
#endif /* BUFAUX_H */