mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
mkvers: fix potential buffer overflow
The space allocated for outputFileBuf is only 2 bytes larger than sizeof(VERS_FILE). But we add potentially 4 extra bytes like ".txt" or ".xml". Just allocate enough space for all file suffices. Change-Id: Ic0f97590be208deaf9c4a5c25e21056ea9d2cd6f Reviewed-on: https://gerrit.openafs.org/12657 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
parent
d7211350ee
commit
a5bedda935
@ -95,7 +95,7 @@ main(int argc, char **argv)
|
|||||||
char *baseDir;
|
char *baseDir;
|
||||||
int argDir = 0;
|
int argDir = 0;
|
||||||
char *outputFile = NULL;
|
char *outputFile = NULL;
|
||||||
char outputFileBuf[sizeof(VERS_FILE) + 2];
|
char outputFileBuf[sizeof(VERS_FILE) + 4];
|
||||||
struct stat sbuf;
|
struct stat sbuf;
|
||||||
time_t versTime;
|
time_t versTime;
|
||||||
int reBuild = 0;
|
int reBuild = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user