You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2022/02/21 20:40:49 UTC

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

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

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


The following commit(s) were added to refs/heads/9.2.x by this push:
     new 3c4d7e3  url_sig: fix bad cast to pointer of different type (#8505)
3c4d7e3 is described below

commit 3c4d7e386f6c935ee2409f970ba109ac2bc292c4
Author: Brian Olsen <bn...@gmail.com>
AuthorDate: Tue Nov 9 12:31:58 2021 -0700

    url_sig: fix bad cast to pointer of different type (#8505)
    
    (cherry picked from commit 90945880560877c8206be76c4fe78d8cfa74febb)
---
 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 37ce8e2..fb0827a 100644
--- a/plugins/experimental/url_sig/url_sig.c
+++ b/plugins/experimental/url_sig/url_sig.c
@@ -382,7 +382,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);
 
@@ -477,13 +478,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.");
     }
   }