Ticket #6329: makeinfo-strcpy-overlap.patch
File makeinfo-strcpy-overlap.patch, 899 bytes (added by , 14 years ago) |
---|
-
makeinfo.c
1 1 /* Makeinfo -- convert Texinfo source files into Info files. 2 $Id : makeinfo.c,v 1.1 2004/10/28 18:14:10 zooey Exp$2 $Id$ 3 3 4 4 Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98 5 5 Free Software Foundation, Inc. … … 1672 1672 void 1673 1673 canon_white (string) 1674 1674 char *string; 1675 { 1675 { 1676 char *temp; 1676 1677 int len = strlen (string); 1677 1678 int x; 1678 1679 … … 1683 1684 { 1684 1685 if (!cr_or_whitespace (string[x])) 1685 1686 { 1686 strcpy (string, string + x); 1687 /* The destination may _not_ overlap ! -- strcpy (string, string + x); */ 1688 temp = malloc(len * sizeof(char) + 1); 1689 strcpy(temp, string+x); 1690 strcpy(string, temp); 1691 free(temp); 1687 1692 break; 1688 1693 } 1689 1694 }