Thread (9 messages) 9 messages, 3 authors, 2022-07-06

Re: [PATCH 2/2] module: Show the last unloaded module's taint flag(s)

From: Aaron Tomlin <hidden>
Date: 2022-06-28 07:47:18
Also in: lkml

On Tue 2022-06-28 05:54 +0000, Christophe Leroy wrote:
quoted
-	/* Store the name of the last unloaded module for diagnostic purposes */
  	strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
+	strcat(last_unloaded_module, module_flags(mod, buf, false));
You replace a bounded string copy by an unbounded strict contat.

Should you use strlcat() instead ?
Hi Christophe,

Why? If I understand correctly, both the destination and source string are
NULL-terminated (see module_flags()). So, strcat() should be sufficient.


Kind regards,

-- 
Aaron Tomlin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help