]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_iax2.c: Don't send unsanitized data to the logger.
authorSean Bright <sean@seanbright.com>
Wed, 8 Nov 2023 13:47:42 +0000 (08:47 -0500)
committerAsterisk Development Team <asteriskteam@digium.com>
Fri, 12 Jan 2024 18:32:13 +0000 (18:32 +0000)
This resolves an issue where non-printable characters could be sent to
the console/log files.

(cherry picked from commit da4e6e7ddb679904bc55d06b2328c842407a4219)

channels/iax2/parser.c

index 449cd1b9ca8588e71d057ae640fedb6d4d4a5fb8..ff025e1c18e8b1ce540175d8c61ee38ef0cddcb9 100644 (file)
@@ -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;