diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-05-13 05:03:17 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-05-13 05:03:17 +0000 |
commit | 4b587cd3ed32b416b43865bcc0afb21d7af3eecb (patch) | |
tree | f748be0ae3d42cd30072b7e49987d995bd81635c | |
parent | d636d65bcc95f4bcaf9e20807b5d954b662e69c9 (diff) | |
download | samba-4b587cd3ed32b416b43865bcc0afb21d7af3eecb.tar.gz samba-4b587cd3ed32b416b43865bcc0afb21d7af3eecb.tar.bz2 samba-4b587cd3ed32b416b43865bcc0afb21d7af3eecb.zip |
test for overflow in nmb name parsing code
(This used to be commit 204a939807d6fe66fcd721aabf7a88ee33eb23d6)
-rw-r--r-- | source3/libsmb/nmblib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index 6c178758c6..f59371d559 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -197,7 +197,7 @@ static int parse_nmb_name(char *inbuf,int offset,int length, struct nmb_name *na unsigned char c1,c2; c1 = ubuf[offset++]-'A'; c2 = ubuf[offset++]-'A'; - if ((c1 & 0xF0) || (c2 & 0xF0)) return(0); + if ((c1 & 0xF0) || (c2 & 0xF0) || (n > sizeof(name->name)-1)) return(0); name->name[n++] = (c1<<4) | c2; m -= 2; } |