Fix EAP-FAST PAC file writer to avoid crash with multiple PACs

One of the pointers to the PAC buffer was not updated after realloc
and if the realloc ended up returning new pointer, the *pos pointer
was still pointing at the old location (i.e., freed memory at
this point).
This commit is contained in:
Jouni Malinen 2010-12-04 11:37:41 -08:00
parent 0f3e4f2a83
commit c4d7fc90a2

View file

@ -497,6 +497,7 @@ static void eap_fast_write(char **buf, char **pos, size_t *buf_len,
*buf = NULL; *buf = NULL;
return; return;
} }
*pos = nbuf + (*pos - *buf);
*buf = nbuf; *buf = nbuf;
*buf_len += need; *buf_len += need;
} }