From fec3449a3ebe22cc7b51694b9563965592e459c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20B=C3=BChler?= Date: Thu, 19 Jan 2023 10:13:41 +0100 Subject: [PATCH 1/3] do not use system include for srtp_priv.h Including srtp_priv.h should only be done form inside source tree. --- include/stream_list_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/stream_list_priv.h b/include/stream_list_priv.h index f49cd551d..b61af188e 100644 --- a/include/stream_list_priv.h +++ b/include/stream_list_priv.h @@ -45,7 +45,7 @@ #ifndef SRTP_STREAM_LIST_PRIV_H #define SRTP_STREAM_LIST_PRIV_H -#include +#include "srtp_priv.h" #ifdef __cplusplus extern "C" { From 70b28c69a2d8250c2c444f18b52f9f41844d2232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20B=C3=BChler?= Date: Mon, 23 Jan 2023 21:45:05 +0100 Subject: [PATCH 2/3] use snprintf instead sprintf sprintf is marked as deprecated in OSX 13.1 --- test/cutest.h | 2 +- test/srtp_driver.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cutest.h b/test/cutest.h index f64667143..ae2b22bff 100644 --- a/test/cutest.h +++ b/test/cutest.h @@ -467,7 +467,7 @@ static void test_run__(const struct test__ *test) signame = "SIGTERM"; break; default: - sprintf(tmp, "signal %d", WTERMSIG(exit_code)); + snprintf(tmp, sizeof(tmp), "signal %d", WTERMSIG(exit_code)); signame = tmp; break; } diff --git a/test/srtp_driver.c b/test/srtp_driver.c index 42229be78..bc245d063 100644 --- a/test/srtp_driver.c +++ b/test/srtp_driver.c @@ -1621,7 +1621,7 @@ char *srtp_packet_to_string(srtp_hdr_t *hdr, int pkt_octet_len) } /* write packet into string */ - sprintf(packet_string, + snprintf(packet_string, sizeof(packet_string), "(s)rtp packet: {\n" " version:\t%d\n" " p:\t\t%d\n" From a3150271bbb66fd284498ca0f061a81398764fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20B=C3=BChler?= Date: Mon, 23 Jan 2023 21:47:26 +0100 Subject: [PATCH 3/3] format --- test/cutest.h | 3 ++- test/srtp_driver.c | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/test/cutest.h b/test/cutest.h index ae2b22bff..94e1087e6 100644 --- a/test/cutest.h +++ b/test/cutest.h @@ -467,7 +467,8 @@ static void test_run__(const struct test__ *test) signame = "SIGTERM"; break; default: - snprintf(tmp, sizeof(tmp), "signal %d", WTERMSIG(exit_code)); + snprintf(tmp, sizeof(tmp), "signal %d", + WTERMSIG(exit_code)); signame = tmp; break; } diff --git a/test/srtp_driver.c b/test/srtp_driver.c index bc245d063..ad722bb6f 100644 --- a/test/srtp_driver.c +++ b/test/srtp_driver.c @@ -1622,21 +1622,21 @@ char *srtp_packet_to_string(srtp_hdr_t *hdr, int pkt_octet_len) /* write packet into string */ snprintf(packet_string, sizeof(packet_string), - "(s)rtp packet: {\n" - " version:\t%d\n" - " p:\t\t%d\n" - " x:\t\t%d\n" - " cc:\t\t%d\n" - " m:\t\t%d\n" - " pt:\t\t%x\n" - " seq:\t\t%x\n" - " ts:\t\t%x\n" - " ssrc:\t%x\n" - " data:\t%s\n" - "} (%d octets in total)\n", - hdr->version, hdr->p, hdr->x, hdr->cc, hdr->m, hdr->pt, hdr->seq, - hdr->ts, hdr->ssrc, octet_string_hex_string(data, hex_len), - pkt_octet_len); + "(s)rtp packet: {\n" + " version:\t%d\n" + " p:\t\t%d\n" + " x:\t\t%d\n" + " cc:\t\t%d\n" + " m:\t\t%d\n" + " pt:\t\t%x\n" + " seq:\t\t%x\n" + " ts:\t\t%x\n" + " ssrc:\t%x\n" + " data:\t%s\n" + "} (%d octets in total)\n", + hdr->version, hdr->p, hdr->x, hdr->cc, hdr->m, hdr->pt, hdr->seq, + hdr->ts, hdr->ssrc, octet_string_hex_string(data, hex_len), + pkt_octet_len); return packet_string; }