Skip to content

Commit 461bf79

Browse files
committed
The 3rd octet of the FIF does, indeed, indicate the length of the internet address/url, however, because pkt includes the FCF byte as the first octet, we find the internet address length in the 4th octet of pkt and not the 3rd.
1 parent f5943c7 commit 461bf79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/t30.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -6270,7 +6270,7 @@ static void decode_url_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int le
62706270
if (msg == NULL)
62716271
msg = text;
62726272
/*endif*/
6273-
if (len < 3 || len > 77 + 3 || len != pkt[2] + 3)
6273+
if (len < 4 || len > 77 + 4 || len != pkt[3] + 4)
62746274
{
62756275
unexpected_frame_length(s, pkt, len);
62766276
msg[0] = '\0';
@@ -6294,8 +6294,8 @@ static void decode_url_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int le
62946294
Bit 7 = 1 for more follows, 0 for last packet in the sequence.
62956295
Bits 6-0 = length
62966296
*/
6297-
memcpy(msg, &pkt[3], len - 3);
6298-
msg[len - 3] = '\0';
6297+
memcpy(msg, &pkt[4], len - 4);
6298+
msg[len - 4] = '\0';
62996299
span_log(&s->logging, SPAN_LOG_FLOW, "Remote fax gave %s as: %d, %d, \"%s\"\n", t30_frametype(pkt[0]), pkt[0], pkt[1], msg);
63006300
}
63016301
/*- End of function --------------------------------------------------------*/

0 commit comments

Comments
 (0)