You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ga...@apache.org on 2017/05/09 20:09:43 UTC
[trafficserver] branch master updated: Converity 1373288:
Dereference after null check
This is an automated email from the ASF dual-hosted git repository.
gancho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 440d290 Converity 1373288: Dereference after null check
440d290 is described below
commit 440d290c53a74d517f3b3d73548fd0e6967336a3
Author: Gancho Tenev <ga...@apache.com>
AuthorDate: Tue May 9 08:44:27 2017 -0700
Converity 1373288: Dereference after null check
Problem:
CID 1373288 (#1 of 1): Dereference after null check (FORWARD_NULL)
20. var_deref_model: Passing null pointer expire to strtol, which dereferences it.
Fix:
Missing expiration query parameter and missing expiration query parameter value
should be treated the same (expire=0).
---
example/secure-link/secure-link.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/example/secure-link/secure-link.c b/example/secure-link/secure-link.c
index d2b691a..b38d9d6 100644
--- a/example/secure-link/secure-link.c
+++ b/example/secure-link/secure-link.c
@@ -116,7 +116,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
sprintf(&hash[i * 2], "%02x", md[i]);
}
time(&t);
- e = strtol(expire, NULL, 16);
+ e = (NULL == expire ? 0 : strtol(expire, NULL, 16));
i = TSREMAP_DID_REMAP;
if (e < t || strcmp(hash, token) != 0) {
if (e < t) {
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].