From 5e854d5060e4874d27049cda500535bb7eabe6d9 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 9 Apr 2019 02:43:20 +0100 Subject: GTK Console input no longer overruns buffer Patch by Kevin Brunelle The console input in gmixvm will only read 70 characters, but the outer loop used 70 (the characters) instead of 14 (the number of words). This caused the VM to read past the end of the buffer and write 56 words of junk into the emulator. --- mixgtk/mixgtk_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mixgtk/mixgtk_device.c b/mixgtk/mixgtk_device.c index 0cae037..1d28b6e 100644 --- a/mixgtk/mixgtk_device.c +++ b/mixgtk/mixgtk_device.c @@ -236,7 +236,7 @@ read_cons_ (mix_word_t *block) if (result == GTK_RESPONSE_OK) { text = g_strdup_printf ("%-70s", gtk_entry_get_text (input_dlg_entry_)); - for (i = 0; i < 70; ++i) + for (i = 0; i < SIZES_[mix_dev_CONSOLE]; ++i) for (j = 0; j < 5; ++j) mix_word_set_byte (block + i, j + 1, mix_char_to_byte -- cgit v1.2.3