Sfoglia il codice sorgente

mosquitto: fix crash on client disconnect

Patch backported from upstream.  Was only noticed on musl and freebsd
clients.  See https://bugs.eclipse.org/bugs/show_bug.cgi?id=475707

Fixes github issue #1692

Signed-off-by: Karl Palsson <karlp@remake.is>
Karl Palsson 9 anni fa
parent
commit
1943d0b44e

+ 1
- 1
net/mosquitto/Makefile Vedi File

@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
10 10
 
11 11
 PKG_NAME:=mosquitto
12 12
 PKG_VERSION:=1.4.3
13
-PKG_RELEASE:=1
13
+PKG_RELEASE:=2
14 14
 PKG_LICENSE:=BSD-3-Clause
15 15
 PKG_LICENSE_FILES:=LICENSE.txt
16 16
 

+ 14
- 0
net/mosquitto/patches/001-free-counting-bug-475707.patch Vedi File

@@ -0,0 +1,14 @@
1
+diff --git a/lib/memory_mosq.c b/lib/memory_mosq.c
2
+index b1f5bfd..4d8217d 100644
3
+--- a/lib/memory_mosq.c
4
++++ b/lib/memory_mosq.c
5
+@@ -54,6 +54,9 @@ void *mosquitto__calloc(size_t nmemb, size_t size)
6
+ void mosquitto__free(void *mem)
7
+ {
8
+ #ifdef REAL_WITH_MEMORY_TRACKING
9
++	if(!mem){
10
++		return;
11
++	}
12
+ 	memcount -= malloc_usable_size(mem);
13
+ #endif
14
+ 	free(mem);