=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/Attic/bufaux.c,v retrieving revision 1.17.2.2 retrieving revision 1.17.2.3 diff -u -r1.17.2.2 -r1.17.2.3 --- src/usr.bin/ssh/Attic/bufaux.c 2002/04/22 19:56:41 1.17.2.2 +++ src/usr.bin/ssh/Attic/bufaux.c 2002/06/02 22:56:09 1.17.2.3 @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: bufaux.c,v 1.17.2.2 2002/04/22 19:56:41 miod Exp $"); +RCSID("$OpenBSD: bufaux.c,v 1.17.2.3 2002/06/02 22:56:09 miod Exp $"); #include #include "bufaux.h" @@ -140,6 +140,7 @@ /* * Returns integers from the buffer (msb first). */ + u_short buffer_get_short(Buffer *buffer) { @@ -207,7 +208,7 @@ /* Get the length. */ len = buffer_get_int(buffer); if (len > 256 * 1024) - fatal("Received packet with bad string length %d", len); + fatal("buffer_get_string: bad string length %d", len); /* Allocate space for the string. Add one byte for a null character. */ value = xmalloc(len + 1); /* Get the string. */ @@ -232,6 +233,8 @@ 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)); }