From: Sean Bright Date: Wed, 8 Nov 2023 13:47:42 +0000 (-0500) Subject: chan_iax2.c: Don't send unsanitized data to the logger. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da4e6e7ddb679904bc55d06b2328c842407a4219;p=thirdparty%2Fasterisk.git chan_iax2.c: Don't send unsanitized data to the logger. This resolves an issue where non-printable characters could be sent to the console/log files. --- diff --git a/channels/iax2/parser.c b/channels/iax2/parser.c index 449cd1b9ca..ff025e1c18 100644 --- a/channels/iax2/parser.c +++ b/channels/iax2/parser.c @@ -1063,7 +1063,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) if (len == (int)sizeof(unsigned int)) { ies->calling_ani2 = ntohl(get_unaligned_uint32(data + 2)); } else { - snprintf(tmp, (int)sizeof(tmp), "callingani2 was %d long: %s\n", len, data + 2); + snprintf(tmp, sizeof(tmp), "Expected callingani2 to be %zu bytes but was %d\n", sizeof(unsigned int), len); errorf(tmp); } break;