Skip Menu |

This queue is for tickets about the Net-SIGTRAN CPAN distribution.

Report information
The Basics
Id: 117695
Status: new
Priority: 0/
Queue: Net-SIGTRAN

People
Owner: Nobody in particular
Requestors: john_cochrane [...] keysight.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: m3UA padding not calculated correctly
Date: Fri, 9 Sep 2016 10:15:38 +0000
To: <bug-Net-SIGTRAN [...] rt.cpan.org>
From: <john_cochrane [...] keysight.com>
In SIGTRAN::M3UA sub encodepdu The section of code to pad a message is: my $mod4=length($message) % 4; for (my $i=0;$i<$mod4;$i++) { $message.=chr(0); } This is incorrect and result in the wrong amount of padding being added. 1) It assumes that the remainder is equal to the amount of padding required, rather than taking the modulus value into account. 2) It does not allow for the fact that adding a padding character/value to the $message, changes the length of $message. A solution is: while (length($message) % 4 != 0) { $message.=chr(0); }