On Thu, Jun 04, 2020 at 02:10:37PM +0800, Zhangfei Gao wrote:I think it is fine.
That's not what I meant. As it is if you do exceed the limit theShould this even allow truncation? Perhaps it'd be better to failI think we do not need consider overrun, since it at most copy size-1 bytes
in case of an overrun?
to dest.
From the manual: strlcpy()
 This function is similar to strncpy(), but it copies at most
size-1 bytes to dest, always adds a terminating null
ÂÂÂÂÂÂ byte,
And simple tested with smaller SIZE of interface.name, only SIZE-1 is
copied, so it is safe.
-#define UACCE_MAX_NAME_SIZEÂÂÂ 64
+#define UACCE_MAX_NAME_SIZEÂÂÂ 4
name is silently truncated. Wouldn't it be better to fail the
allocation instead?