Hi.

On Tue, 2019-01-15 at 10:58 +0100, Francesco Pretto wrote:
> On Tue, 15 Jan 2019 at 10:44, Francesco Pretto <cez...@gmail.com>
> wrote:
> >  Also, you are not allocation large enough buffer there, it
> > > should be:
> > >    sizeof(pdf_utf16be) * (lLenUtf16 + 1)
> > > similarly with the next podofo_malloc(),
> > 
> > I just copied the size from the previous allocation with VLA so I
> > guess if it's wrong now it was wrong also before?

No, it wasn't, it was a stack-allocated array of pdf_utf16be. I'm also
wondering why the change didn't cause a crash when you ran it.

I'm sorry for my ignorance, but what does VLA stand for, please? I
guess I can easily construct tens of words which would construct the
same abbreviation. Also, you really didn't answer my question, I'm
looking for an exact error message from the development environment you
received and try to address.

Looking a bit more closely to the patch, is it about the stack-
allocated array size being specified by an argument of the function,
instead of a static size known during compile time? I'm wondering why
also gcc doesn't claim about it. That might be wrong at least in C (I
think that, but I do not know that).

> Ah ok, I got it. Yes, std::vector usage is definitely better choice.

No, it's not. Why to add an overhead of the std::vector class on
something what is a string, a plain character array? Just add
podofo_free() on appropriate places and fix the other things and that's
it.
        Bye,
        zyx




_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to