From: Jason Boyer Date: Mon, 11 Jan 2021 14:59:39 +0000 (-0500) Subject: LP1461978: Fix Segfault in History Library X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=987939c3b0a19b5699f84ac4a3e576f5131ecc5d;p=working%2FOpenSRF.git LP1461978: Fix Segfault in History Library It appears an attempt was made to limit history entries to 5000 by setting history_size to 5000. There are 2 issues with this: first, history_size is something that is retieved, not something that is set; and secondly, to correctly set history_max_size we need to call stifle_history(5000). Signed-off-by: Jason Boyer --- diff --git a/src/srfsh/srfsh.c b/src/srfsh/srfsh.c index 1887bac..079021f 100644 --- a/src/srfsh/srfsh.c +++ b/src/srfsh/srfsh.c @@ -310,7 +310,7 @@ static int load_history( void ) { history_file = strdup(fbuf); if(!access(history_file, W_OK | R_OK )) { - history_length = 5000; + stifle_history(5000); read_history(history_file); } return 1;