Module: kamailio
Branch: 5.8
Commit: 91b0962679092f28abb5022d1505372356460f7d
URL: 
https://github.com/kamailio/kamailio/commit/91b0962679092f28abb5022d1505372356460f7d

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-03-20T13:15:21+01:00

acc: more log messages of failure arsing extra acc string

(cherry picked from commit 04a73ace6572dd5c95a8f50b39b2ce712f7ebe84)

---

Modified: src/modules/acc/acc_extra.c

---

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

---

diff --git a/src/modules/acc/acc_extra.c b/src/modules/acc/acc_extra.c
index 255057a99c4..a84f02bbe02 100644
--- a/src/modules/acc/acc_extra.c
+++ b/src/modules/acc/acc_extra.c
@@ -127,8 +127,10 @@ struct acc_extra *parse_acc_extra(char *extra_str)
                foo = s;
                while(*s && !isspace((int)*s) && EQUAL != *s)
                        s++;
-               if(*s == 0)
+               if(*s == 0) {
+                       LM_ERR("unexpected end of string\n");
                        goto parse_error;
+               }
                if(*s == EQUAL) {
                        extra->name.len = (s++) - foo;
                } else {
@@ -136,8 +138,10 @@ struct acc_extra *parse_acc_extra(char *extra_str)
                        /* skip spaces */
                        while(*s && isspace((int)*s))
                                s++;
-                       if(*s != EQUAL)
+                       if(*s != EQUAL) {
+                               LM_ERR("unexpected char '%c' instead of '='\n", 
*s);
                                goto parse_error;
+                       }
                        s++;
                }
                extra->name.s = foo;
@@ -149,15 +153,19 @@ struct acc_extra *parse_acc_extra(char *extra_str)
                /* get value type */
                stmp.s = s;
                stmp.len = strlen(s);
-               if((foo = pv_parse_spec(&stmp, &extra->spec)) == 0)
+               if((foo = pv_parse_spec(&stmp, &extra->spec)) == 0) {
+                       LM_ERR("failed to parse variable name\n");
                        goto parse_error;
+               }
                s = foo;
 
                /* skip spaces */
                while(*s && isspace((int)*s))
                        s++;
-               if(*s && (*(s++) != SEPARATOR || *s == 0))
+               if(*s && (*(s++) != SEPARATOR || *s == 0)) {
+                       LM_ERR("unexpected char at end of name=var group\n");
                        goto parse_error;
+               }
        }
 
        /* go throught all extras and make the names null terminated */

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to