[sr-dev] git:5.1:2b5c88ed: auth_radius: fix gcc 7 warning

Victor Seva linuxmaniac at torreviejawireless.org
Fri Dec 15 11:53:01 CET 2017


Module: kamailio
Branch: 5.1
Commit: 2b5c88eda48fc50a582318d8ccdfa7c121806ee6
URL: https://github.com/kamailio/kamailio/commit/2b5c88eda48fc50a582318d8ccdfa7c121806ee6

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2017-12-15T11:51:41+01:00

auth_radius: fix gcc 7 warning

> CC (gcc) [M auth_radius.so]		sterman.o
> sterman.c: In function 'extract_avp':
> sterman.c:78:61: warning: comparison between pointer and zero character constant [-Wpointer-compare]
>    if(!q && p == vp->strvalue && vp->strvalue + sizeof(char) != '\0') {
>                                                              ^~
> sterman.c:78:33: note: did you mean to dereference the pointer?
>    if(!q && p == vp->strvalue && vp->strvalue + sizeof(char) != '\0') {
>                                  ^

(cherry picked from commit 35b3d3c32d775ccea28f36d81a0b84e4a168db89)

---

Modified: src/modules/auth_radius/sterman.c

---

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

---

diff --git a/src/modules/auth_radius/sterman.c b/src/modules/auth_radius/sterman.c
index db50b39df6..25eac9c9f5 100644
--- a/src/modules/auth_radius/sterman.c
+++ b/src/modules/auth_radius/sterman.c
@@ -75,7 +75,7 @@ static inline int extract_avp(
 	if(vp->attribute == attrs[A_SIP_AVP].v && vp->type == PW_TYPE_STRING) {
 		p = strchr(vp->strvalue, '#');
 		q = strchr(vp->strvalue, ':');
-		if(!q && p == vp->strvalue && vp->strvalue + sizeof(char) != '\0') {
+		if(!q && p == vp->strvalue && *(vp->strvalue + sizeof(char)) != '\0') {
 			r = p;
 			r = strchr(r++, '#');
 		} else




More information about the sr-dev mailing list