bug-gettext
[Top][All Lists]
Advanced

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

Re: [bug-gettext] xgettext segmentation fault javascript


From: Daiki Ueno
Subject: Re: [bug-gettext] xgettext segmentation fault javascript
Date: Wed, 29 Oct 2014 11:37:46 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Jesper Fehrlund <address@hidden> writes:

> I'm no c expert by any means, but does this not run xstrdup on a
> dangling pointer?
> (since best_cp->msgid and best_cp->msgid_plural points to the same
> address which has been released in remember_a_message)

Good point, thanks.  That part is really tricky.  In the code:

  mp = remember_a_message (..., best_cp->msgid, ...);
  if (mp != NULL && best_cp->msgid_plural != NULL)
    remember_a_message_plural (..., best_cp->msgid_plural, ...);

If MP is non-NULL, that means best_cp->msgid is saved in MP, and
remember_a_message_plural can still refer to the address pointed by
best_cp->msgid.

Of course, it is an implementation detail and the confusing dangling
pointer should be avoided.  I'm thinking to cleanup the code, also by
moving the code conversion stuff to earlier phase.

Regards,
--
Daiki Ueno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]