brbzull0 commented on a change in pull request #7364:
URL: https://github.com/apache/trafficserver/pull/7364#discussion_r534404504



##########
File path: plugins/experimental/memory_profile/memory_profile.cc
##########
@@ -49,26 +49,28 @@ CallbackHandler(TSCont cont, TSEvent id, void *data)
     TSDebug(PLUGIN_NAME, "Message to '%s' - %zu bytes of data", msg->tag, 
msg->data_size);
     if (strcmp(PLUGIN_NAME, msg->tag) == 0) { // Message is for us
 #if TS_HAS_JEMALLOC
-      int retval = 0;
-      if (strncmp((char *)msg->data, "dump", msg->data_size) == 0) {
-        if ((retval = mallctl("prof.dump", nullptr, nullptr, nullptr, 0)) != 
0) {
-          TSError("mallct(prof.dump) failed retval=%d errno=%d", retval, 
errno);
+      if (msg->data_size) {

Review comment:
       strncmp:
   >  The behavior is undefined when either lhs or rhs is the null pointer.
   
   Not sure if the size = 0 will stop the function to check the ptr. Probably 
is safe this way.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to