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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-05-03T20:15:18+02:00

core: strutils - cast to unsigned for shifting in urldecode()

---

Modified: src/core/strutils.c

---

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

---

diff --git a/src/core/strutils.c b/src/core/strutils.c
index 431b9d3c8fd..e64299855f7 100644
--- a/src/core/strutils.c
+++ b/src/core/strutils.c
@@ -912,7 +912,8 @@ int urldecode(str *sin, str *sout)
        while(p < end) {
                if(*p == '%') {
                        if(p + 2 < end) {
-                               *at++ = hex_to_char(p[1]) << 4 | 
hex_to_char(p[2]);
+                               *at++ = (((unsigned char)hex_to_char(p[1])) << 
4)
+                                               | (unsigned 
char)hex_to_char(p[2]);
                                p += 2;
                        }
                } else if(*p == '+') {

_______________________________________________
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