On 03/12/12 13:56, Felix Fietkau wrote: > On 2012-12-03 1:42 PM, Frank Meerkötter wrote: >> Hi, >> >> i noticed that strncpy wasn't used correctly here. >> Please review/apply. >> >> Patch follows: >> >> From the man page: >> [...] >> The strncpy() function is similar, except that at most n >> bytes of src are copied. Warning: If there is no null byte >> among the first n bytes of src, the string placed in dest >> will not be null-terminated. >> [...] > As far as I know, this is not a problem for these ioctls. The kernel > should handle this corner case properly.
I agree that it is not a real problem but i would argue that the patch still has value. By using the canonical form of strncpy() its easy for everyone reading the source to verify that its correct without inspecting other layers. It is also giving a bad example which might get "reused" at other places where it would matter. Kind Regards, Frank _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
