On 06/07/2018 04:19 AM, Viresh Kumar wrote: > On 07-06-18, 11:18, Johan Hovold wrote: >> If you want to work around the warning and think you can do it in some >> non-contrived way, then go for it. >> >> Clearing the request buffer, checking for termination using strnlen, and >> then using memcpy might not be too bad. >> >> But after all, it is a false positive, so leaving things as they stand >> is fine too. > > Leave it then :) > It's interesting that the warning isn't reported for this in fw_mgmt_interface_fw_version_operation(). The difference there is that you actually put a zero byte at that last position before returning. I'm mildly impressed if gcc is distinguishing that. You *are* returning the fw_info->firmware_tag array newly filled with a non-null-terminated string in one of the two cases that get warnings in "fw-management.c". But the other one is only updating a buffer in a local/automatic variable. Weird. I wish there were a non-clumsy way of marking false positives like this as A-OK. -Alex -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html