acassis commented on code in PR #17122:
URL: https://github.com/apache/nuttx/pull/17122#discussion_r2391016900


##########
binfmt/binfmt_loadmodule.c:
##########
@@ -122,6 +122,12 @@ static int load_absmodule(FAR struct binary_s *bin, FAR 
const char *filename,
 
           binfo("Successfully loaded module %s\n", filename);
 
+          /* Save the filename of the loaded module */
+
+#ifdef CONFIG_BINFMT_STORE_FILENAME
+          strlcpy(bin->fname, filename, sizeof(bin->fname));

Review Comment:
   @jlaitine although there is already other places in the code that checks for 
filename size, I suggest using NAME_MAX instead of sizeof(bin->fname) to reduce 
the chance someone inject a buffer overflow by populating fname with a big 
string



-- 
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: [email protected]

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

Reply via email to