Re: [xml] [PATCH] Two trivial fixes for Control Flow Integrity support



I've updated the patches.

On Wed, Nov 8, 2017 at 11:46 AM Nick Wellnhofer <wellnhofer aevum de> wrote:
On 08/11/2017 19:48, Vlad Tsyrklevich via xml wrote:
> The patches fix type signature mismatches with xmlNop() and
> xmlMemStrdup(). The first patch sets xmlNop() to have the same type
> signature as xmlInputReadCallback, which is the only type it's ever
> cast to.

Can you rename xmlNop to something like xmlInputNopReadCallback and remove the
now unnecessary casts when it is used? Also annotate the unused parameters
with ATTRIBUTE_UNUSED.

> Under some compiler flags, xmlMemStrdup() is a function
> pointer pointing to xmlStrdup() despite a mismatched type signature.
> In that case I set it to strdup() instead since it has the correct
> type signature and the other xmlMem(Malloc|Realloc|Free) function
> pointers around it point directly to the libc implementations as well.

strdup is a POSIX extension and can't be used for platform compatibility
reasons. You'll probably have to write a wrapper around xmlStrdup.

If possible, please format patches with git-format-patch.

Nick

Attachment: 0001-Refactor-name-and-type-signature-for-xmlNop.patch
Description: Text Data

Attachment: 0002-Introduce-xmlPosixStrdup-and-update-xmlMemStrdup.patch
Description: Text Data



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