mirror of
https://github.com/tildeclub/ex-vi.git
synced 2026-01-24 10:20:18 +00:00
* Fixed an error in the realloc() function in mapmalloc.c that sometimes
caused memory to be overwritten because memcpy(new, old, size) was called with the size of 'new' if 'new' was larger than 'old'.
This commit is contained in:
3
Changes
3
Changes
@@ -40,6 +40,9 @@ Release ...
|
||||
* Ex does not exit on errors immediately anymore if standard input is not
|
||||
a terminal but a pipe or regular file.
|
||||
* The 'substitute' ex command can now be abbreviated as 'sub', 'subst' etc.
|
||||
* Fixed an error in the realloc() function in mapmalloc.c that sometimes
|
||||
caused memory to be overwritten because memcpy(new, old, size) was called
|
||||
with the size of 'new' if 'new' was larger than 'old'.
|
||||
|
||||
Release 1/19/05
|
||||
* The last release erroneously made 'X' work like 'x' in visual mode. It now
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* September 2001.
|
||||
*/
|
||||
|
||||
/* Sccsid @(#)mapmalloc.c 1.14 (gritter) 11/26/04 */
|
||||
/* Sccsid @(#)mapmalloc.c 1.15 (gritter) 2/17/05 */
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
|
||||
@@ -508,7 +508,7 @@ realloc(char *ptr, size_t usize)
|
||||
}
|
||||
if ((vp = malloc(usize)) == NULL)
|
||||
return NULL;
|
||||
memcpy(vp, ptr, usize);
|
||||
memcpy(vp, ptr, mc->mc_usize);
|
||||
free(ptr);
|
||||
return vp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user