ref: 5cb91f28ba609d04d8948860c34520b66ea16718
parent: ea8da331e361c96a7e563b0a91dc3535e0d1d545
author: Jonas Kölker <jonaskoelker@yahoo.com>
date: Thu Oct 1 10:00:47 EDT 2015
Fix a memory error in Guess cursor handling.
--- a/guess.c
+++ b/guess.c
@@ -777,6 +777,8 @@
set_peg(&from->params, ui, ui->peg_cur, 0);
ret = "";
} else if (button == 'H' || button == 'h') {
+ if (ui->peg_cur == from->params.npegs)
+ return NULL;
ui->display_cur = 1;
ui->holds[ui->peg_cur] = 1 - ui->holds[ui->peg_cur];
ret = "";