... | ... |
@@ -523,8 +523,9 @@ int ki_autheph_authenticate(sip_msg_t *_m, str *susername, str *spassword) |
523 | 523 |
{ |
524 | 524 |
LM_DBG("generated password: %.*s\n", |
525 | 525 |
sgenerated_password.len, sgenerated_password.s); |
526 |
- if (strncmp(spassword->s, sgenerated_password.s, |
|
527 |
- spassword->len) == 0) |
|
526 |
+ if (spassword->len == sgenerated_password.len |
|
527 |
+ && strncmp(spassword->s, sgenerated_password.s, |
|
528 |
+ spassword->len) == 0) |
|
528 | 529 |
{ |
529 | 530 |
SECRET_UNLOCK; |
530 | 531 |
return AUTH_OK; |