diff options
author | Linus Nordberg <linus@nordberg.se> | 2010-05-25 22:55:04 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2010-05-25 22:55:04 +0200 |
commit | 684ade53a2ed77a1ee12577208e75a95ccec3fc3 (patch) | |
tree | e8a55abc6636fbe9a77519e1344f55ce70ea68ee | |
parent | 2e9d382f6a8ed0f746471972efe244ec33924064 (diff) |
* radsecproxy.c (extractattr): Bug! When s is changed, update len. This might actually work now!
-rw-r--r-- | radsecproxy.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index ff9dbfe..4f79293 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -2335,19 +2335,20 @@ struct tlv *extractattr(char *nameval) { struct tlv *a; s = strchr(nameval, ':'); - name = atoi(nameval); if (!s) return NULL; - len = strlen(s + 1); - if (len > 253) - return NULL; + name = atoi(nameval); + /* Two ':' means that we have vendor:name:val. */ s2 = strchr(s + 1, ':'); - if (s2) { /* Two ':' means we have vendor:name:val. */ + if (s2) { vendor = name; name = atoi(s + 1); s = s2; } + len = strlen(s + 1); + if (len > 253) + return NULL; if (name < 1 || name > 255) return NULL; |