Fixed lock-up when sending too long UDH IE, error message generated:
authorshort <>
Sun, 13 Jan 2002 15:05:39 +0000 (15:05 +0000)
committershort <>
Sun, 13 Jan 2002 15:05:39 +0000 (15:05 +0000)
  "UDH IE (User Data Header Information Element) too long to fit in one SMS fragment"
 - occurs when: sum(static_IEs)+max(dynamic_IEs) > USERDATA_LENGTH

GSM/SMS/NBS/Message.pm

index f9e27f8..101ce01 100644 (file)
@@ -226,8 +226,12 @@ sub _store_try {
                my $payload_now="";          # text  from $payload       placed in the current SMS part
                while (1) {
                        if (@udhpositioned && $udhpositioned[0]{TEXT_POSITION} <= $position) { # "<=" should be "=="
-                               last if USERDATA_LENGTH < length($self->_udh_build(@udhstatic,@udhpositioned_now,$udhpositioned[0]))
-                                               +nail_payload_len($dcs,length($payload_now));
+                               if (USERDATA_LENGTH < length($self->_udh_build(@udhstatic,@udhpositioned_now,$udhpositioned[0]))
+                                               +nail_payload_len($dcs,length($payload_now))) {
+                                       return "UDH IE (User Data Header Information Element) too long to fit in one SMS fragment"
+                                                       if $payload_now eq "";
+                                       last;
+                                       }
 
                                my %udhei=%{shift @udhpositioned};  # copy it to local state - we will be modifying it
                                # we subtract the absolute position base of current SMS part: