Search Postgresql Archives

Re: pg crashing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



BTW, just looking at win32_shmem.c ...

    retptr = malloc(bufsize + 1 + 18);    /* 1 NULL and 18 for
                                           * Global\PostgreSQL: */
    if (retptr == NULL)
        elog(FATAL, "could not allocate memory for shared memory name");

    strcpy(retptr, "Global\\PostgreSQL:");
    r = GetFullPathName(DataDir, bufsize, retptr + 11, NULL);

Surely that "11" ought to be "18".  Also, since the loop immediately
below this is going to convert \ to /, wouldn't it be clearer to
describe the path prefix as Global/PostgreSQL: in the first place?

(BTW, as far as I can tell the +1 added to the malloc request is
useless: bufsize includes the trailing null, and the code would
not work if it did not.)

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux