hw/9pfs: avoid buffer overrun
v9fs_add_dir_node and qemu_v9fs_synth_add_file used strncpyto form node->name, which requires NUL-termination, butstrncpy does not ensure NUL-termination.Use pstrcpy, which does.
Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>...
lm32: avoid buffer overrun
Actually do what the comment says, using pstrcpy NUL-terminate:strncpy does not always do that.
Signed-off-by: Jim Meyering <meyering@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
bt: replace fragile snprintf use and unwarranted strncpy
In bt_hci_name_req a failed snprintf could return len larger thansizeof(params.name), which means the following memset call wouldhave a "length" value of (size_t)-1, -2, etc... Sounds scary.But currently, one can deduce that there is no problem:...
virtio-9p: avoid unwarranted uses of strncpy
In all of these cases, the uses of strncpy were unnecessary, sinceat each point of use we know that the NUL-terminated source bytesfit in the destination buffer. Use memcpy in place of strncpy.
vscsi: avoid unwarranted strncpy
Don't use strncpy when the source string is known to fitin the destination buffer. Use equivalent memcpy.We could even use strcpy, here, but some static analyzerswarn about that, so don't add new uses.
Acked-by: David Gibson <david@gibson.dropbear.id.au>...
scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL
Use g_strdup rather than strdup, because the sole caller(qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferencesit. Besides, in that caller, the allocated buffer is already freed with...
Merge remote-tracking branch 'sstabellini/xen-2012-10-03' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
View revisions
Also available in: Atom