File: 0001-Fix-string-size-taking-into-account-the-0-character.patch

package info (click to toggle)
belle-sip 5.3.105%2Bdfsg-4.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,480 kB
  • sloc: ansic: 276,717; cpp: 3,172; cs: 418; makefile: 185; python: 86; xml: 47; sh: 41; objc: 38; ruby: 8
file content (34 lines) | stat: -rw-r--r-- 1,212 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From e01d007009a80525ce82b6dae2caa59a54bdc4ab Mon Sep 17 00:00:00 2001
From: Andrea Gianarda <andrea.gianarda@belledonne-communications.com>
Date: Wed, 14 May 2025 11:33:50 +0200
Subject: Fix string size taking into account the '\0'-character

---
 src/dns/dns.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dns/dns.c b/src/dns/dns.c
index 55a77f07..42efbaae 100644
--- a/src/dns/dns.c
+++ b/src/dns/dns.c
@@ -2790,7 +2790,7 @@ int dns_aaaa_cmp(const struct dns_aaaa *a, const struct dns_aaaa *b) {
 } /* dns_aaaa_cmp() */
 
 size_t dns_aaaa_arpa(void *_dst, size_t lim, const struct dns_aaaa *aaaa) {
-	static const unsigned char hex[16] = "0123456789abcdef";
+	static const unsigned char hex[17] = "0123456789abcdef";
 	struct dns_buf dst = DNS_B_INTO(_dst, lim);
 	unsigned nyble;
 	int i, j;
@@ -3382,7 +3382,7 @@ int dns_sshfp_cmp(const struct dns_sshfp *a, const struct dns_sshfp *b) {
 } /* dns_sshfp_cmp() */
 
 size_t dns_sshfp_print(void *_dst, size_t lim, struct dns_sshfp *fp) {
-	static const unsigned char hex[16] = "0123456789abcdef";
+	static const unsigned char hex[17] = "0123456789abcdef";
 	struct dns_buf dst = DNS_B_INTO(_dst, lim);
 	size_t i;
 
-- 
2.30.2