Mercurial > vim
comparison src/memline.c @ 22959:4cce4a5d3fd3 v8.2.2026
patch 8.2.2026: Coverity warns for possibly using not NUL terminated string
Commit: https://github.com/vim/vim/commit/e79cdb69a4905ccf766494265d4c6f8701d10c39
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 21 13:51:16 2020 +0100
patch 8.2.2026: Coverity warns for possibly using not NUL terminated string
Problem: Coverity warns for possibly using not NUL terminated string.
Solution: Put a NUL in b0_hname just in case.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 21 Nov 2020 14:00:03 +0100 |
parents | 83c2c489cb1b |
children | b545334ae654 |
comparison
equal
deleted
inserted
replaced
22958:e7c125224b1a | 22959:4cce4a5d3fd3 |
---|---|
2250 { | 2250 { |
2251 char_u hostname[B0_HNAME_SIZE]; | 2251 char_u hostname[B0_HNAME_SIZE]; |
2252 | 2252 |
2253 mch_get_host_name(hostname, B0_HNAME_SIZE); | 2253 mch_get_host_name(hostname, B0_HNAME_SIZE); |
2254 hostname[B0_HNAME_SIZE - 1] = NUL; | 2254 hostname[B0_HNAME_SIZE - 1] = NUL; |
2255 b0.b0_hname[B0_HNAME_SIZE - 1] = NUL; // in case of corruption | |
2255 if (STRICMP(b0.b0_hname, hostname) != 0) | 2256 if (STRICMP(b0.b0_hname, hostname) != 0) |
2256 ret = FALSE; | 2257 ret = FALSE; |
2257 } | 2258 } |
2258 | 2259 |
2259 // process must be known and not be running | 2260 // process must be known and not be running |