You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ez...@apache.org on 2021/11/10 16:25:44 UTC

[trafficserver] branch 8.1.x updated: url_sig: fix bad cast to pointer of different type (#8510)

This is an automated email from the ASF dual-hosted git repository.

eze pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.1.x by this push:
     new 0d51dc3  url_sig: fix bad cast to pointer of different type (#8510)
0d51dc3 is described below

commit 0d51dc3a7c5e5e853a158ae095917f1ac4e17b60
Author: Brian Olsen <bn...@gmail.com>
AuthorDate: Wed Nov 10 09:25:36 2021 -0700

    url_sig: fix bad cast to pointer of different type (#8510)
    
    (cherry picked from commit 057f914f870b2af5c66c7540186f2a58b08cb9bc)
---
 plugins/experimental/url_sig/url_sig.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/experimental/url_sig/url_sig.c b/plugins/experimental/url_sig/url_sig.c
index 8f20a38..ef9b613 100644
--- a/plugins/experimental/url_sig/url_sig.c
+++ b/plugins/experimental/url_sig/url_sig.c
@@ -357,7 +357,8 @@ urlParse(char const *const url_in, char *anchor, char *new_path_seg, int new_pat
   unsigned char decoded_string[2048] = {'\0'};
   char new_url[8192]; /* new_url is not null_terminated */
   char *p = NULL, *sig_anchor = NULL, *saveptr = NULL;
-  int i = 0, numtoks = 0, decoded_len = 0, sig_anchor_seg = 0;
+  int i = 0, numtoks = 0, sig_anchor_seg = 0;
+  size_t decoded_len = 0;
 
   strncat(url, url_in, sizeof(url) - strlen(url) - 1);
 
@@ -452,13 +453,12 @@ urlParse(char const *const url_in, char *anchor, char *new_path_seg, int new_pat
   // no signature anchor was found so decode and save the signing parameters assumed
   // to be in the last path segment.
   if (sig_anchor == NULL) {
-    if (TSBase64Decode(segment[numtoks - 2], strlen(segment[numtoks - 2]), decoded_string, sizeof(decoded_string),
-                       (size_t *)&decoded_len) != TS_SUCCESS) {
+    if (TSBase64Decode(segment[numtoks - 2], strlen(segment[numtoks - 2]), decoded_string, sizeof(decoded_string), &decoded_len) !=
+        TS_SUCCESS) {
       TSDebug(PLUGIN_NAME, "Unable to decode the  path parameter string.");
     }
   } else {
-    if (TSBase64Decode(sig_anchor, strlen(sig_anchor), decoded_string, sizeof(decoded_string), (size_t *)&decoded_len) !=
-        TS_SUCCESS) {
+    if (TSBase64Decode(sig_anchor, strlen(sig_anchor), decoded_string, sizeof(decoded_string), &decoded_len) != TS_SUCCESS) {
       TSDebug(PLUGIN_NAME, "Unable to decode the  path parameter string.");
     }
   }