mirror of
https://github.com/cryb-to/cryb-otp.git
synced 2024-11-25 15:05:41 +00:00
Add a couple of assertions.
This commit is contained in:
parent
95dd5ca993
commit
2cb49e6151
1 changed files with 3 additions and 1 deletions
|
@ -39,6 +39,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <cryb/assert.h>
|
||||||
#include <cryb/md5.h>
|
#include <cryb/md5.h>
|
||||||
|
|
||||||
#include "otpradiusd.h"
|
#include "otpradiusd.h"
|
||||||
|
@ -291,7 +292,7 @@ rad_decode_str(const rad_attribute *ra, const uint8_t **str, size_t *len)
|
||||||
warnx("unknown attribute 0x%02x", ra->code);
|
warnx("unknown attribute 0x%02x", ra->code);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
// assert(rad_attr_def[rac].type == rat_string);
|
assert(rad_attr_def[rac].type == rat_string);
|
||||||
if ((int)ra->length < 3 || (int)ra->length > MAX_RADATTR_LEN) {
|
if ((int)ra->length < 3 || (int)ra->length > MAX_RADATTR_LEN) {
|
||||||
warnx("invalid attribute length");
|
warnx("invalid attribute length");
|
||||||
return (-1);
|
return (-1);
|
||||||
|
@ -333,6 +334,7 @@ handle_access_request(rad_transaction *rx)
|
||||||
end = (uint8_t *)&rx->request + rx->reqlen;
|
end = (uint8_t *)&rx->request + rx->reqlen;
|
||||||
user = pass = NULL;
|
user = pass = NULL;
|
||||||
userlen = passlen = 0;
|
userlen = passlen = 0;
|
||||||
|
assert(req->code == rmc_access_request);
|
||||||
while (nextra + MIN_RADATTR_LEN < end) {
|
while (nextra + MIN_RADATTR_LEN < end) {
|
||||||
ra = (rad_attribute *)nextra;
|
ra = (rad_attribute *)nextra;
|
||||||
if ((int)ra->length < MIN_RADATTR_LEN ||
|
if ((int)ra->length < MIN_RADATTR_LEN ||
|
||||||
|
|
Loading…
Reference in a new issue