fix a buffer overflow and an underflow

This commit is contained in:
Bill Currie 2004-01-17 05:11:34 +00:00
parent 249aee2e9f
commit 629e22aa61
2 changed files with 2 additions and 2 deletions

View file

@ -185,7 +185,7 @@ Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame,
pdaliasframe = (daliasframe_t *) pin;
strcpy (frame->name, pdaliasframe->name);
strncpy (frame->name, pdaliasframe->name, sizeof (frame->name));
frame->firstpose = (*posenum);
frame->numposes = 1;

View file

@ -514,7 +514,7 @@ Qgetline (QFile *file)
return 0;
len = strlen (buf);
while (buf[len - 1] != '\n') {
while (len && buf[len - 1] != '\n') {
char *t = realloc (buf, size + 256);
if (!t)