mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
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>
This commit is contained in:
@@ -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).
|
||||
*/
|
||||
|
Reference in New Issue
Block a user