From 2c456a433a556d464f0f08825d7454c6326c6b89 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Sun, 19 Nov 2000 16:58:57 +0000 Subject: Fix buffer overruns: - packet-afs.c: dissect_acl() didn't restrict the size of a string read with sscanf(). An exploit has been released. - packet-nbns.c: When passed an illegal name, get_nbns_name() would overrun nbname with an error message. This isn't exploitable AFAIK, but it could result in a crash. - packet-ntp.c: dissect_ntp() wasn't checking the length of the reference clock's host name. This is most likely exploitable. This fix simply lops off the end of the host name if it's too long. We should probably add an ellipsis (...) as we have done in other places in the code. svn path=/trunk/; revision=2671 --- packet-nbns.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packet-nbns.c') diff --git a/packet-nbns.c b/packet-nbns.c index 30c3f414bf..2bd7aa04bb 100644 --- a/packet-nbns.c +++ b/packet-nbns.c @@ -4,7 +4,7 @@ * Gilbert Ramirez * Much stuff added by Guy Harris * - * $Id: packet-nbns.c,v 1.47 2000/11/19 08:54:00 guy Exp $ + * $Id: packet-nbns.c,v 1.48 2000/11/19 16:58:57 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -194,13 +194,15 @@ nbns_type_name (int type) return "unknown"; } +#define NBNAME_BUF_LEN 128 + static int get_nbns_name(const u_char *pd, int offset, int nbns_data_offset, char *name_ret, int *name_type_ret) { int name_len; char name[MAXDNAME]; - char nbname[NETBIOS_NAME_LEN]; + char nbname[NBNAME_BUF_LEN]; char *pname, *pnbname, cname, cnbname; int name_type; -- cgit v1.2.3