Module: kamailio
Branch: master
Commit: 0e02061319df55da027840809641c3e2dece8f3a
URL: 
https://github.com/kamailio/kamailio/commit/0e02061319df55da027840809641c3e2dece8f3a

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-05-12T08:24:33+02:00

core: set upper limit for b58 encode input

---

Modified: src/core/basex.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/0e02061319df55da027840809641c3e2dece8f3a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/0e02061319df55da027840809641c3e2dece8f3a.patch

---

diff --git a/src/core/basex.c b/src/core/basex.c
index 3ffdeb4187f..256b62f1aee 100644
--- a/src/core/basex.c
+++ b/src/core/basex.c
@@ -440,6 +440,10 @@ char *b58_encode(char *b58, int *b58sz, char *data, int 
binsz)
        ssize_t i, j, high, zcount = 0;
        size_t size;
 
+       if(binsz > 16 * 1024 * 1024) {
+               return NULL;
+       }
+
        while(zcount < binsz && !bin[zcount])
                ++zcount;
 

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to