diff options
Diffstat (limited to 'games-board/gnugo/files')
-rw-r--r-- | games-board/gnugo/files/gnugo-3.9.1-format-security.patch | 60 | ||||
-rw-r--r-- | games-board/gnugo/files/gnugo-3.9.1-invalid-move.patch | 21 |
2 files changed, 81 insertions, 0 deletions
diff --git a/games-board/gnugo/files/gnugo-3.9.1-format-security.patch b/games-board/gnugo/files/gnugo-3.9.1-format-security.patch new file mode 100644 index 000000000000..7828187c571d --- /dev/null +++ b/games-board/gnugo/files/gnugo-3.9.1-format-security.patch @@ -0,0 +1,60 @@ +diff --git a/patterns/dfa.c b/patterns/dfa.c +index 3689616..2d2f8c6 100644 +--- a/patterns/dfa.c ++++ b/patterns/dfa.c +@@ -279,7 +279,7 @@ resize_dfa(dfa_t *pdfa, int max_states, int max_indexes) + * dump a dfa (debugging purpose). + */ + +-static const char *line = ++static const char line[] = + "----------------------------------------------------\n"; + + void +diff --git a/patterns/mkpat.c b/patterns/mkpat.c +index 70a6964..5f1f1dd 100644 +--- a/patterns/mkpat.c ++++ b/patterns/mkpat.c +@@ -1419,7 +1419,7 @@ generate_autohelper_code(int funcno, int number_of_params, int *labels) + /* A common case. Just use the labels as parameters. */ + switch (number_of_params) { + case 0: +- code_pos += sprintf(code_pos, autohelper_functions[funcno].code); ++ code_pos += sprintf(code_pos, "%s", autohelper_functions[funcno].code); + break; + case 1: + code_pos += sprintf(code_pos, autohelper_functions[funcno].code, +diff --git a/patterns/uncompress_fuseki.c b/patterns/uncompress_fuseki.c +index 3290b05..c67a733 100644 +--- a/patterns/uncompress_fuseki.c ++++ b/patterns/uncompress_fuseki.c +@@ -224,9 +224,9 @@ main(int argc, char *argv[]) + + assert(boardsize > 0); + if (boardsize > MAX_BOARD) { +- printf(output_strings[PREAMBLE]); ++ printf("%s", output_strings[PREAMBLE]); + printf(output_strings[HEADER], boardsize); +- printf(output_strings[FOOTER]); ++ printf("%s", output_strings[FOOTER]); + return EXIT_SUCCESS; + } + +@@ -251,7 +251,7 @@ main(int argc, char *argv[]) + board[k][boardsize + 1] = '|'; + } + +- printf(output_strings[PREAMBLE]); ++ printf("%s", output_strings[PREAMBLE]); + printf(output_strings[HEADER], boardsize); + + +@@ -308,7 +308,7 @@ main(int argc, char *argv[]) + if (mode == C_OUTPUT) + write_pattern_c_code(NULL, board1d, NO_MOVE, 0, boardsize, -1); + +- printf(output_strings[FOOTER]); ++ printf("%s", output_strings[FOOTER]); + + return EXIT_SUCCESS; + } diff --git a/games-board/gnugo/files/gnugo-3.9.1-invalid-move.patch b/games-board/gnugo/files/gnugo-3.9.1-invalid-move.patch new file mode 100644 index 000000000000..1da388a043b5 --- /dev/null +++ b/games-board/gnugo/files/gnugo-3.9.1-invalid-move.patch @@ -0,0 +1,21 @@ +From 84a32e9cee2a70c0ec6ef58c1be279fed84a9a53 Mon Sep 17 00:00:00 2001 +From: Gunnar Farnebäck <gunnar@lysator.liu.se> +Date: Thu, 13 Jun 2013 18:45:03 +0000 +Subject: Avoid crashing due to registering an invalid loss move reason. + +--- +diff --git a/engine/value_moves.c b/engine/value_moves.c +index e9f2daa..7ec8fdd 100644 +--- a/engine/value_moves.c ++++ b/engine/value_moves.c +@@ -383,7 +383,7 @@ do_find_more_owl_attack_and_defense_moves(int color, int pos, + int dcode = owl_does_defend(pos, dd, &kworm); + + if (dcode >= DRAGON2(dd).owl_defense_code) { +- if (dcode == LOSS) ++ if (dcode == LOSS && kworm != NO_MOVE) + add_loss_move(pos, dd, kworm); + else + add_owl_defense_move(pos, dd, dcode); +-- +cgit v0.9.0.2 |