Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 383403 | Differences between
and this patch

Collapse All | Expand All

(-)chktex-1.6.4/FindErrs.c (-1 / +19 lines)
Lines 184-189 static char *GetLTXToken(char *Src, char Link Here
184
#define GET_TOKEN       256
184
#define GET_TOKEN       256
185
#define GET_STRIP_TOKEN 257
185
#define GET_STRIP_TOKEN 257
186
186
187
static void ShiftLeftOne(char *Buf)
188
{
189
    char *P;
190
191
    for (P = Buf + 1; *P; ++P)
192
      *(P - 1) = *P;
193
    *(P - 1) = '\0';
194
}
195
187
static char *GetLTXArg(char *SrcBuf, char *OrigDest, const int Until,
196
static char *GetLTXArg(char *SrcBuf, char *OrigDest, const int Until,
188
	struct WordList *wl)
197
	struct WordList *wl)
189
{
198
{
Lines 218-224 static char *GetLTXArg(char *SrcBuf, cha Link Here
218
227
219
        if (Retval && (*OrigDest == '{') && (Until == GET_STRIP_TOKEN))
228
        if (Retval && (*OrigDest == '{') && (Until == GET_STRIP_TOKEN))
220
        {
229
        {
221
            strcpy(OrigDest, OrigDest + 1);
230
	    /* According to strcpy(3): The strings may not overlap
231
	       So the following call:
232
233
	          strcpy(OrigDest, OrigDest + 1);
234
235
	       is undefined, and it DOES produce errors in new versions
236
	       of glibc (checked on glibc-2.12.2).
237
238
	       Call safe version. */
239
   	    ShiftLeftOne(OrigDest);
222
            OrigDest[strlen(OrigDest) - 1] = 0;
240
            OrigDest[strlen(OrigDest) - 1] = 0;
223
        }
241
        }
224
        break;
242
        break;

Return to bug 383403