bugfix for a memory-reuse bug spost and whom
authorPhilipp Takacs <philipp@bureaucracy.de>
Sat, 2 May 2015 12:36:50 +0000 (14:36 +0200)
committerPhilipp Takacs <philipp@bureaucracy.de>
Sat, 2 May 2015 12:46:35 +0000 (14:46 +0200)
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
uip/whom.c

index 48f9797..ac2843f 100644 (file)
@@ -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);
index e61dc62..4b15fbd 100644 (file)
@@ -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);