You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/14 02:02:01 UTC

[GitHub] [incubator-tvm] liangfu commented on a change in pull request #6044: [RUNTIME][CRT] init TVMPackedFunc's name

liangfu commented on a change in pull request #6044:
URL: https://github.com/apache/incubator-tvm/pull/6044#discussion_r454051962



##########
File path: src/runtime/crt/common/packed_func.c
##########
@@ -85,6 +85,7 @@ int TVMPackedFunc_InitGlobalFunc(TVMPackedFunc* pf, const char* name, const TVMA
     return status;
   }
 
+  strncpy(pf->name, name, sizeof(pf->name));

Review comment:
       Please use `snprintf` instead, since `strncpy` is unsafe. see https://stackoverflow.com/questions/12275381/strncpy-vs-sprintf




----------------------------------------------------------------
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:
users@infra.apache.org