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 22:33:51 UTC

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

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



##########
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:
       yea, these are just things im porting over from our 8.1.x branch for this as we've fixed things, and I think my editor may have stripped that out, Ill add it back




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