[sr-dev] [kamailio/kamailio] rtpengine : crash is fixed and codec flags added to doc (#1742)

Richard Fuchs notifications at github.com
Fri Nov 30 16:44:39 CET 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20181130/5372d396/attachment.html>


More information about the sr-dev mailing list