]> Savannah Git Hosting - mdk.git/commitdiff

Savannah Git Hosting - mdk.git/commitdiff

git git@sv / mdk.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b72dc79)
GTK Console input no longer overruns buffer
Tue, 9 Apr 2019 01:43:20 +0000 (02:43 +0100)
Tue, 9 Apr 2019 01:43:20 +0000 (02:43 +0100)
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.


diff --git a/mixgtk/mixgtk_device.c b/mixgtk/mixgtk_device.c
index 0cae037975683f7c06bd0c9fb14d6e1965d0379f..1d28b6e7dc9440e7513263b4dbb13806c91ae27b 100644 (file)
--- 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
GNU MIX Development Kit (MDK)
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /