Re: pg crashing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg crashing
Дата
Msg-id 11759.1215011878@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg crashing  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Felipe de Jesús Molina Bravo
Дата:
Сообщение: Re: SRF written in C
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump - lost synchronization with server: got message type "d", length 6036499