minor fix

This commit is contained in:
lgandx 2013-12-26 10:28:45 -05:00
commit 938f9bd533

View file

@ -240,6 +240,7 @@ def Validate_NBT_NS(data,Wredirect):
def Decode_Name(nbname):
#From http://code.google.com/p/dpkt/ with author's permission.
try:
if len(nbname) != 32:
return nbname
l = []
@ -247,6 +248,8 @@ def Decode_Name(nbname):
l.append(chr(((ord(nbname[i]) - 0x41) << 4) |
((ord(nbname[i+1]) - 0x41) & 0xf)))
return ''.join(l).split('\x00', 1)[0].strip()
except:
return "Illegal NetBIOS name"
# NBT_NS Server class.
class NB(BaseRequestHandler):
@ -1611,3 +1614,4 @@ if __name__ == '__main__':
raise
raw_input()