Re: OFFTOPIC: core dumped with strcpy,atoi,sprintf.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: OFFTOPIC: core dumped with strcpy,atoi,sprintf.
Дата
Msg-id 15950.1347640654@sss.pgh.pa.us
обсуждение исходный текст
Ответ на OFFTOPIC: core dumped with strcpy,atoi,sprintf.  ("Ing.Edmundo.Robles.Lopez" <erobles@sensacd.com.mx>)
Ответы Re: OFFTOPIC: core dumped with strcpy,atoi,sprintf.  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
"Ing.Edmundo.Robles.Lopez" <erobles@sensacd.com.mx> writes:
> Debugging the program, found that the core is generated  by atoi,
> sprintf and similar functions; because that functions fails when
> received  a null pointer (NULL). But, if  the functions received  an
> empty string ("") the program continues and run succesfully.

> Yes,  I should validate each input pointers. But, its odd that works in
> SCO and not in Linux, and its odder that fails in functions like strcpy,
> atoi, sprintf, etc.

Not really.  Per the POSIX spec, the behavior of those functions is
undefined for NULL input pointers.  Some platforms are forgiving about
it, most are not.

            regards, tom lane


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

Предыдущее
От: "Ing.Edmundo.Robles.Lopez"
Дата:
Сообщение: OFFTOPIC: core dumped with strcpy,atoi,sprintf.
Следующее
От: Yvon Thoraval
Дата:
Сообщение: Re: SQLSTATE[08006] [7] server closed the connection unexpectedly