]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- don't crash on uninitialized buffers if getcwd fails (die predictably)
authorsaq <saq@pld-linux.org>
Sun, 10 Apr 2005 09:11:39 +0000 (09:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-getcwd.patch -> 1.1

rpm-getcwd.patch [new file with mode: 0644]

diff --git a/rpm-getcwd.patch b/rpm-getcwd.patch
new file mode 100644 (file)
index 0000000..f641a87
--- /dev/null
@@ -0,0 +1,20 @@
+--- rpm-4.3/build.c.orig       2005-04-10 02:35:15.000000000 +0200
++++ rpm-4.3/build.c    2005-04-10 02:35:43.000000000 +0200
+@@ -206,7 +206,7 @@
+          directory for this run */
+       if (*arg != '/') {
+-          (void)getcwd(buf, BUFSIZ);
++          if (getcwd(buf, BUFSIZ) == NULL) strcpy(buf, ".");
+           strcat(buf, "/");
+           strcat(buf, arg);
+       } else 
+@@ -225,7 +225,7 @@
+     specut = urlPath(specURL, &specFile);
+     if (*specFile != '/') {
+       char *s = alloca(BUFSIZ);
+-      (void)getcwd(s, BUFSIZ);
++      if (getcwd(s, BUFSIZ) == NULL) strcpy(s, ".");
+       strcat(s, "/");
+       strcat(s, arg);
+       specURL = s;
This page took 0.293263 seconds and 4 git commands to generate.