Just for record. (Actually it could be also without any checks like was in podofo 0.9.5 and rather crash with null pointer and non-zero length as in other places in podofo.)
On Sun, Oct 28, 2018 at 3:47 PM zyx <z...@gmx.us> wrote: > On 27.10.2018 at 19:46 Michal Sudolsky wrote: > > Actually better would be this: > > > > if( lLen == 0 ) > > { > > return 0; > > } > > > > if( !pBuffer ) > > { > > PODOFO_RAISE_ERROR( ePdfError_InvalidHandle ); > > } > > > > If pointer is NULL but length is not zero then it should throw. If > > length is zero then write is no-op but it should not call memcpy with > > null as seems this is undefined behaviour even if length is zero. > > Hi, > you replied only to me, not to the list. Private mails do not help others. > > Pity you didn't tell before the commit. Nonetheless, there might not be > a big difference, unless the caller is not PoDoFo itself (passing NULL > buffer, but non-zero length). Thus I'd not change it. > Bye, > zyx >
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users