From: Lars-Peter Clausen Date: Tue, 5 Jun 2012 16:24:12 +0000 (+0200) Subject: iio: iio_enum_available_read: Prevent possible buffer overflow X-Git-Tag: v3.6-rc1~100^2~898 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74dcd439bf8c16b01f9f5a9dffb2b171ed94e2e5;p=pandora-kernel.git iio: iio_enum_available_read: Prevent possible buffer overflow Use scnprint instead of snprintf, because snprintf returns the number of bytes that would have been written to the buffer if there was enough space, and as a result writing to buf[len-1] might cause a access beyond the buffers limits. Reported-by: Dan Carpenter Signed-off-by: Lars-Peter Clausen Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed