aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/vim.h
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2015-02-20 16:32:58 +0100
committerEliseo Martínez <eliseomarmol@gmail.com>2015-03-22 11:31:46 +0100
commitfb44a233a5be72d8d1cfd02e300db7de2b4bf428 (patch)
tree45b36935e02b4763b2fc84d0d019903286ff3bc3 /src/nvim/vim.h
parent4fc0291c730f3c42df4692dd91b09cfd806479d7 (diff)
downloadrneovim-fb44a233a5be72d8d1cfd02e300db7de2b4bf428.tar.gz
rneovim-fb44a233a5be72d8d1cfd02e300db7de2b4bf428.tar.bz2
rneovim-fb44a233a5be72d8d1cfd02e300db7de2b4bf428.zip
coverity/13777: String not null terminated: RI.
Problem : String not null terminated @ 1543. Diagnostic : Real issue. Rationale : We are reading a struct block0, which contains some string fields, from a file, without checking for string fields to be correctly terminated. That could cause a buffer overrun if file has somehow been garbled. Resolution : Add string fields check for nul termination. Mark issue as intentional (there seems to be no way of teaching coverity about read_eintr being ok that way). Helped-by: oni-link <knil.ino@gmail.com>
Diffstat (limited to 'src/nvim/vim.h')
-rw-r--r--src/nvim/vim.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/vim.h b/src/nvim/vim.h
index 29d61dcbde..410c2602c8 100644
--- a/src/nvim/vim.h
+++ b/src/nvim/vim.h
@@ -322,13 +322,10 @@ enum {
(size_t)(n))
#ifndef EINTR
-# define read_eintr(fd, buf, count) vim_read((fd), (buf), (count))
-# define write_eintr(fd, buf, count) vim_write((fd), (buf), (count))
+# define read_eintr(fd, buf, count) read((fd), (buf), (count))
+# define write_eintr(fd, buf, count) write((fd), (buf), (count))
#endif
-# define vim_read(fd, buf, count) read((fd), (char *)(buf), (size_t) (count))
-# define vim_write(fd, buf, count) write((fd), (char *)(buf), (size_t) (count))
-
/*
* Enums need a typecast to be used as array index (for Ultrix).
*/