From dc81afc84b4d53177a1c4fb9fd6fea0ec2912825 Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Sat, 2 May 2015 14:36:50 +0200 Subject: [PATCH] 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. --- uip/spost.c | 2 +- uip/whom.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 1.7.10.4