aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-06-15 10:03:05 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2011-06-24 00:08:11 +0000
commit60d645a4e9e7e7ddc20e534fea82aa4e6947f911 (patch)
tree656848db8b14b92993df040058df24ce7012cb8b /virt/kvm
parenttarget: Drop bogus ERR_PTR usage in target_fabric_configfs_init (diff)
downloadlinux-dev-60d645a4e9e7e7ddc20e534fea82aa4e6947f911.tar.xz
linux-dev-60d645a4e9e7e7ddc20e534fea82aa4e6947f911.zip
target: Fix incorrect strlen() NULL terminator checks
This patch fixes a number of cases in target core using an incorrectly if (strlen(foo) > SOME_MAX_SIZE) As strlen() returns the number of characters in the string not counting the NULL character at the end. So if you do something like: char buf[10]; if (strlen("0123456789") > 10) return -ETOOLONG; snprintf(buf, 10, "0123456789"); printf("%s\n", buf); then the last "9" gets chopped off and only "012345678" is printed. Plus I threw in one small related cleanup. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'virt/kvm')
0 files changed, 0 insertions, 0 deletions