]> granicus.if.org Git - postgresql/commitdiff
Enlarge find_other_exec's meager fgets buffer
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 19 Apr 2018 13:45:15 +0000 (10:45 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 19 Apr 2018 13:45:15 +0000 (10:45 -0300)
The buffer was 100 bytes long, which is barely sufficient when the
version string gets longer (such as by configure --with-extra-version).
Set it to MAXPGPATH.

Author: Nikhil Sontakke
Discussion: https://postgr.es/m/CAMGcDxfLfpYU_Jru++L6ARPCOyxr0W+2O3Q54TDi5XdYeU36ow@mail.gmail.com

src/common/exec.c

index d736b02280d9cd5f121d9473962a5510e13ba062..4206e22d6d28d6ed76959235b8110999a12db177 100644 (file)
@@ -308,7 +308,7 @@ find_other_exec(const char *argv0, const char *target,
                                const char *versionstr, char *retpath)
 {
        char            cmd[MAXPGPATH];
-       char            line[100];
+       char            line[MAXPGPATH];
 
        if (find_my_exec(argv0, retpath) < 0)
                return -1;