| To: vim_dev@googlegroups.com |
| Subject: Patch 7.4.812 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.4.812 |
| Problem: Gcc sanitizer complains about using a NULL pointer to memmove(). |
| Solution: Only call memmove when there is something to move. (Vittorio |
| Zecca) |
| Files: src/memline.c |
| |
| |
| |
| |
| |
| *** 3834,3840 **** |
| (buf->b_ml.ml_stack_size + STACK_INCR)); |
| if (newstack == NULL) |
| return -1; |
| ! mch_memmove(newstack, buf->b_ml.ml_stack, |
| (size_t)top * sizeof(infoptr_T)); |
| vim_free(buf->b_ml.ml_stack); |
| buf->b_ml.ml_stack = newstack; |
| --- 3834,3841 ---- |
| (buf->b_ml.ml_stack_size + STACK_INCR)); |
| if (newstack == NULL) |
| return -1; |
| ! if (top > 0) |
| ! mch_memmove(newstack, buf->b_ml.ml_stack, |
| (size_t)top * sizeof(infoptr_T)); |
| vim_free(buf->b_ml.ml_stack); |
| buf->b_ml.ml_stack = newstack; |
| |
| |
| |
| *** 743,744 **** |
| --- 743,746 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 812, |
| /**/ |
| |
| -- |
| DEAD PERSON: I'm getting better! |
| CUSTOMER: No, you're not -- you'll be stone dead in a moment. |
| MORTICIAN: Oh, I can't take him like that -- it's against regulations. |
| The Quest for the Holy Grail (Monty Python) |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |