ports/devel/git/files/patch-setup.c
Wesley Shields d0b563983c Address buffer overflow vulnerability. This is a patch pulled from upstream
until 1.7.2 is release real soon now.

Security:	827bc2b7-95ed-11df-9160-00e0815b8da8
2010-07-23 00:38:55 +00:00

11 lines
372 B
C

--- ./setup.c.orig 2010-07-22 11:30:51.186311264 -0400
+++ ./setup.c 2010-07-22 11:32:10.173155632 -0400
@@ -170,6 +170,8 @@
char path[PATH_MAX];
size_t len = strlen(suspect);
+ if (PATH_MAX <= len + strlen("/objects"))
+ die("Too long path: %.*s", 60, suspect);
strcpy(path, suspect);
if (getenv(DB_ENVIRONMENT)) {
if (access(getenv(DB_ENVIRONMENT), X_OK))