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 2021/07/28 20:59:07 UTC

[GitHub] [trafficserver] randall commented on a change in pull request #8181: Various maxmind_acl fixes

randall commented on a change in pull request #8181:
URL: https://github.com/apache/trafficserver/pull/8181#discussion_r678647746



##########
File path: plugins/experimental/maxmind_acl/mmdb.cc
##########
@@ -498,8 +507,11 @@ Acl::eval_country(MMDB_entry_data_s *entry_data, const char *path, int path_len)
   bool ret     = false;
   bool allow   = default_allow;
   char *output = nullptr;
-  output       = static_cast<char *>(malloc((sizeof(char) * entry_data->data_size)));
+
+  // We need to null terminate the iso_code ourselves, they are unterminated in the DBs
+  output = (char *)malloc((sizeof(char) * (entry_data->data_size + 1)));

Review comment:
       can this be changed back to the static_cast?




-- 
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