Re: [REVIEW] Re: Fix xpath() to return namespace definitions

Поиск
Список
Период
Сортировка
От Ali Akbar
Тема Re: [REVIEW] Re: Fix xpath() to return namespace definitions
Дата
Msg-id CACQjQLr0AsSTz9m84nHXwTX2=WrYE6++C2gy-CRoz3G8D19wTg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [REVIEW] Re: Fix xpath() to return namespace definitions  (Ali Akbar <the.apaan@gmail.com>)
Ответы Re: [REVIEW] Re: Fix xpath() to return namespace definitions  (Ali Akbar <the.apaan@gmail.com>)
Re: [REVIEW] Re: Fix xpath() to return namespace definitions  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Greetings,

Attached modified patch to handle xmlCopyNode returning NULL. The patch is larger because xmlerrcxt must be passed to xml_xmlnodetoxmltype (xmlerrcxt is needed for calling xml_ereport).

From libxml2 source, it turns out that the other cases that xmlCopyNode will return NULL will not happen. So in this patch i assume that the only case is memory exhaustion.

But i found some bug in libxml2's code, because we call xmlCopyNode with 1 as the second parameter, internally xmlCopyNode will call xmlStaticCopyNode recursively via xmlStaticCopyNodeList. And xmlStaticCopyNodeList doesn't check the return of xmlStaticCopyNode whether it's NULL. So if someday the recursion returns NULL (maybe because of memory exhaustion), it will SEGFAULT.

Knowing this but in libxml2 code, is this patch is still acceptable?

Thanks,
Ali Akbar
Вложения

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

Предыдущее
От: Benedikt Grundmann
Дата:
Сообщение: Is there a way to temporarily disable a index
Следующее
От: Etsuro Fujita
Дата:
Сообщение: No exact/lossy block information in EXPLAIN ANALYZE for a bitmap heap scan