Buffer overflows are one of the most well-known software vulnerabilities. Even though most developers know what buffer overflows are, attacks against the vulnerabilities are common in both legacy and newer applications. A classic buffer overflow exploit begins with the attacker sending data to a program, which it then stores in an undersized stack buffer. Besides stack buffer overflows, other kinds of buffer overflows include heap overflows, off-by-one errors and many others. Learn more about buffer overflows on OWASP attack index.
Easily used incorrectly.
xmlrpc-c/src/xmlrpc-c-1.39.13/lib/abyss/src/file.c
The highlighted line of code below is the trigger point of this particular Alpine 3.9 buffer weakness.
fileinfo->time_write = fileinfo->data.ftLastWriteTime.dwLowDateTime;
}
*retvalP = found;
#endif
#endif
}
static void
fileFindNextPosix(TFileFind * const filefindP,
TFileInfo * const fileinfoP,
bool * const retvalP) {
#ifndef _WIN32
struct dirent * deP;
deP = readdir(filefindP->handle);
if (deP) {
char z[NAME_MAX+1];
struct stat fs;
strcpy(fileinfoP->name, deP->d_name);
strcpy(z, filefindP->path);
strncat(z, "/",NAME_MAX);
strncat(z, fileinfoP->name, NAME_MAX);
z[NAME_MAX] = '\0';
stat(z, &fs);
if (fs.st_mode & S_IFDIR)
fileinfoP->attrib = A_SUBDIR;
else
fileinfoP->attrib = 0;
fileinfoP->size = fs.st_size;
fileinfoP->time_write = fs.st_mtime;
*retvalP = true;
} else
*retvalP = false;
#endif
}
bool
FileFindNext(TFileFind * const filefindP,
TFileInfo * const fileinfo) {