From a6089f9cd3145fb2af58b10cd31866b46b78858f Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 18 Jun 2012 20:57:44 +0300 Subject: [PATCH] overflow: remove strncpy() false positives We generate the list of overflow functions automatically. If we see a place that does: strncpy(foo, bar, sizeof(bar)); then we assume that the second parameter of the function should always be at least the number of bytes passed in parameter three. Normally people do this the right way which is: strncpy(foo, bar, sizeof(foo)); But sometimes they do it the wrong way and we need to ignore them. Signed-off-by: Dan Carpenter --- smatch_data/kernel.sizeof_param.remove | 1 + 1 file changed, 1 insertion(+) diff --git a/smatch_data/kernel.sizeof_param.remove b/smatch_data/kernel.sizeof_param.remove index 9ebd2ae9..5ba7163d 100644 --- a/smatch_data/kernel.sizeof_param.remove +++ b/smatch_data/kernel.sizeof_param.remove @@ -1,3 +1,4 @@ printk find_first_zero_bit dvb_usb_generic_rw +strncpy 2 1 -- 2.11.4.GIT