@xkaraman commented on this pull request.


> +
+       /* Build pattern with operator prefix */
+       pat_buf = pkg_malloc(pattern->len + 3);
+       if(!pat_buf) {
+               LM_ERR("no pkg memory\n");
+               return -1;
+       }
+
+       pat.s = pat_buf;
+       pat.len = pattern->len + 2;
+       pat.s[pat.len] = '\0';
+
+       /* Prepend operator prefix to pattern */
+       if(op->len == 5 && strncmp(op->s, "regex", 5) == 0) {
+               pat.s[0] = '~';
+               pat.s[1] = '~';

Got it. Modified so that it fowrards whatever the user provided. Add a small 
input check for length either to be 0 (act like a regex) or 2 for the rest of 
the operators, and fail if something else was given.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4492#discussion_r2585430273
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4492/review/[email protected]>
_______________________________________________
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