diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2021-10-18 02:11:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 17:11:23 -0700 |
commit | aff444659e59a16da7e225b9f820a884a05044e6 (patch) | |
tree | 6a4d10fe8436e67b48282e4ca69fa90f5609d5c2 /src/nvim/marktree.c | |
parent | ffc28dcbdb0d3ea7f1f70d1f9627d423f950d224 (diff) | |
download | rneovim-aff444659e59a16da7e225b9f820a884a05044e6.tar.gz rneovim-aff444659e59a16da7e225b9f820a884a05044e6.tar.bz2 rneovim-aff444659e59a16da7e225b9f820a884a05044e6.zip |
fix(PVS/V1028): prevent possible overflow #16023
Full warning: "Possible overflow. Consider casting operands, not the
result."
https://pvs-studio.com/en/docs/warnings/v1028/
Diffstat (limited to 'src/nvim/marktree.c')
-rw-r--r-- | src/nvim/marktree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c index fd7012e895..39c1e36147 100644 --- a/src/nvim/marktree.c +++ b/src/nvim/marktree.c @@ -467,7 +467,7 @@ static mtnode_t *merge_node(MarkTree *b, mtnode_t *p, int i) unrelative(x->key[x->n].pos, &x->key[x->n+1+k].pos); } if (x->level) { - memmove(&x->ptr[x->n+1], y->ptr, (size_t)(y->n + 1) * sizeof(mtnode_t *)); + memmove(&x->ptr[x->n+1], y->ptr, ((size_t)y->n + 1) * sizeof(mtnode_t *)); for (int k = 0; k < y->n+1; k++) { x->ptr[x->n+k+1]->parent = x; } @@ -489,7 +489,7 @@ static void pivot_right(MarkTree *b, mtnode_t *p, int i) mtnode_t *x = p->ptr[i], *y = p->ptr[i+1]; memmove(&y->key[1], y->key, (size_t)y->n * sizeof(mtkey_t)); if (y->level) { - memmove(&y->ptr[1], y->ptr, (size_t)(y->n + 1) * sizeof(mtnode_t *)); + memmove(&y->ptr[1], y->ptr, ((size_t)y->n + 1) * sizeof(mtnode_t *)); } y->key[0] = p->key[i]; refkey(b, y, 0); |