From: Philipp Takacs Date: Sat, 2 May 2015 12:36:50 +0000 (+0200) Subject: bugfix for a memory-reuse bug spost and whom X-Git-Tag: mmh-0.2-RC1~32^2~5 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=dc81afc84b4d53177a1c4 bugfix for a memory-reuse bug spost and whom spost and whom use add to initialize a temporary char*. This pointer maybe points to internal data or already freed memory. Now getcpy is used. --- diff --git a/uip/spost.c b/uip/spost.c index 48f9797..ac2843f 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -228,7 +228,7 @@ main(int argc, char **argv) case FLDPLUS: compnum++; - cp = add(buf, cp); + cp = getcpy(buf); while (state == FLDPLUS) { state = m_getfld(state, name, buf, sizeof(buf), in); diff --git a/uip/whom.c b/uip/whom.c index e61dc62..4b15fbd 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -193,7 +193,7 @@ process(char *file) case FLDPLUS: compnum++; - cp = add(buf, cp); + cp = getcpy(buf); while (state == FLDPLUS) { state = m_getfld(state, name, buf, sizeof(buf), in);