rfuchs commented on this pull request.


> @@ -1992,6 +1992,10 @@ static int parse_flags(struct ng_flags_parse 
> *ng_flags, struct sip_msg *msg, enu
                if (str_key_val_prefix(&key, "transcode", &val, &s)
                                || str_key_val_prefix(&key, "codec-transcode", 
&val, &s))
                {
+                       if(s.len<=0 && s.s==NULL){

There's actually a much better solution to this, which is to change 
`str_key_val_prefix()`, which is where the bug actually is.

The function should read:

```
static inline int str_key_val_prefix(const str *p, const char *q, const str *v, 
str *out) {
        if (str_eq(p, q)) {
                if (!v->s || !v->len)
                        return 0;
                *out = *v;
                return 1;
        }
...
`

Then all the explicit null checks here and below can be removed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1742#pullrequestreview-180319163
_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to