You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/12/16 05:26:51 UTC

[GitHub] [trafficserver] maskit commented on a diff in pull request #9256: Use snprintf instead of sprintf

maskit commented on code in PR #9256:
URL: https://github.com/apache/trafficserver/pull/9256#discussion_r1050383384


##########
example/plugins/c-api/secure_link/secure_link.c:
##########
@@ -125,7 +125,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
   EVP_MD_CTX_destroy(ctx);
 #endif
   for (i = 0; i < MD5_DIGEST_LENGTH; i++) {
-    sprintf(&hash[i * 2], "%02x", md[i]);
+    snprintf(&hash[i * 2], 32, "%02x", md[i]);

Review Comment:
   I don't understand this one. Do we have another `hash`? I only find `char hash[32]`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org