Module: kamailio
Branch: master
Commit: 1f2b5af4bb8f0dd562ef33589736c9ab4b48b7e1
URL:
https://github.com/kamailio/kamailio/commit/1f2b5af4bb8f0dd562ef33589736c9a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-11-02T13:54:39+01:00
auth_identity: safer condition not to overflow building date header
---
Modified: modules/auth_identity/auth_hdrs.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1f2b5af4bb8f0dd562ef33589736c9a…
Patch:
https://github.com/kamailio/kamailio/commit/1f2b5af4bb8f0dd562ef33589736c9a…
---
diff --git a/modules/auth_identity/auth_hdrs.c b/modules/auth_identity/auth_hdrs.c
index 708366b..238c664 100644
--- a/modules/auth_identity/auth_hdrs.c
+++ b/modules/auth_identity/auth_hdrs.c
@@ -551,7 +551,7 @@ int append_date(str *sdate, int idatesize, time_t *tout, struct
sip_msg *msg)
}
ilen=strftime(date_str, sizeof(date_str), AUTH_TIME_FORMAT, bd_time);
- if (ilen > sizeof(date_hf) - strlen("Date: \r\n") || ilen==0) {
+ if (ilen >= sizeof(date_hf) - strlen("Date: \r\n.") || ilen==0) {
LOG(L_ERR, "AUTH_IDENTITY:append_date: unexpected time length\n");
return -3;
}