# HG changeset patch # User Matti Hamalainen # Date 1307761283 -10800 # Node ID 7c96f52e9a3bcf45554c22a4f64c2b85122ba5fe # Parent a0c001672b4401dcfa62b186d8d95fe73d4ad15d memset() history buffer variable unconditionally to avoid derefencing uninitialized memory. diff -r a0c001672b44 -r 7c96f52e9a3b nnchat.c --- a/nnchat.c Sat Jun 11 06:00:31 2011 +0300 +++ b/nnchat.c Sat Jun 11 06:01:23 2011 +0300 @@ -1249,6 +1249,7 @@ cfgitem_t *tmpcfg; char *homeDir = NULL; + memset(histBuf, 0, sizeof(histBuf)); /* Initialize */ th_init("NNChat", "Newbie Nudes chat client", NN_VERSION, @@ -1458,7 +1459,6 @@ if (cursesInit) { /* Initialize rest of interactive UI code */ - memset(histBuf, 0, sizeof(histBuf)); nn_editbuf_clear(editBuf); /* First update of screen */