Menu

#2 Patch for 64-bit

open
nobody
None
5
2008-07-25
2008-07-25
Anonymous
No

I found a bug in pySMPP, in 64-bit arch struct.unpack was not working ok. Unsigned integer should be specified:

Index: pdu.py

RCS file: /cvsroot/pysmpp/pysmpp/pySMPP/pdu.py,v
retrieving revision 1.2
diff -c -r1.2 pdu.py
*** pdu.py 2 Sep 2003 14:21:54 -0000 1.2
--- pdu.py 25 Jul 2008 21:38:40 -0000
***************
*** 38,44 ****
( self.command_length,
self.command_id,
self.command_status,
! self.sequence_number ) = struct.unpack('>iiii',s[0:16])
l = len(s[16:])
if l > 0:
self.body = struct.unpack(`l`+'s',s[16:])[0]
--- 38,44 ----
( self.command_length,
self.command_id,
self.command_status,
! self.sequence_number ) = struct.unpack('>IIII',s[0:16])
l = len(s[16:])
if l > 0:
self.body = struct.unpack(`l`+'s',s[16:])[0]
***************
*** 72,78 ****
if not b:
b = ''
l = len(b)
! return struct.pack('>iiii'+`l`+'s',self.command_length, self.command_id,
self.command_status, self.sequence_number, b)

def dump(self):
--- 72,78 ----
if not b:
b = ''
l = len(b)
! return struct.pack('>IIII'+`l`+'s',self.command_length, self.command_id,
self.command_status, self.sequence_number, b)

def dump(self):

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.