Replace strncpy() with strlcpy() when copying the interface name into ifr.ifr_name in link_status(). This ensures proper NUL-termination and addresses a potential issue flagged by Coverity static analysis.
No functional change intended.
Differential D54752
ifconfig: Use strlcpy() instead of strncpy() for interface name copy Authored by amy.vargas_netapp.com on Jan 16 2026, 9:53 PM. Tags None Referenced Files
Details Replace strncpy() with strlcpy() when copying the interface name into ifr.ifr_name in link_status(). This ensures proper NUL-termination and addresses a potential issue flagged by Coverity static analysis. No functional change intended. Build completed successfully
Diff Detail
Event Timeline
Comment Actions The commit message says “no functional change intended” but there is one: strncpy() zero-fills the unused portion of the buffer, strlcpy() does not, so this leaves ifr partly uninitialized. It probably doesn't matter in this direction, but I don't see this addressed anywhere in the review. Comment Actions The kernel shall alway be robust against userland's input. A proper NUL-terminated string or not, zero-filled the unused portion of the buffer or not, shall not make any differences. So I think No functional change intended is proper in this case. | ||||||||||||||||||||||||||||||||||