realloc in rlm_pam

Frank Cusack fcusack at fcusack.com
Thu Dec 22 04:51:30 CET 2005


On December 21, 2005 12:58:53 PM +0100 Nicolas Baradakis <nbk at sitadelle.com> wrote:
> Wolfgang Rosenauer wrote:
>
>> just found this one in 1.0.x and 1.1 branch code in rlm_pam.c:
>>
>> # define GET_MEM if (reply) realloc(reply, size); else reply =
>> rad_malloc(size); \
>>
>> This is changed on trunk already but it should be changed on 1.0 and 1.1
>> branches as well, because it really seems to fail if the statement is
>> true but realloc() has to move the memory to another location. reply is
>> not updated in this case. So the easiest fix would be:
>>
>> # define GET_MEM if (reply) reply = realloc(reply, size); else reply =
>> rad_malloc(size); \
>
> Thanks for the report. The fix above is trivial, so I've added it to
> the branch 1.1.
>
> As Alan said, we'd like to close off any change to 1.1.0, that's why
> I didn't pull the changes from CVS head.

Since GET_MEM is a bug anyway (even when re-written to be correct),
why not pull from the head?  It's not that severe of a change.

-frank



More information about the Freeradius-Devel mailing list