Reply to post:

Did you hear the one about Cisco routers using strcpy insecurely for login authentication? Makes you go AAAAA-AAAAAAArrg *segfault*

Phil O'Sophical Silver badge

Or better yet, the strncpy_s function that is standard in C11.

strncpy isn't a good choice, not least because it doesn't null-terminate excessively-long strings. strlcpy guarantees that there will be no overflow, it's a much safer option.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon