Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1434 closed bug (fixed (in master))

SIGSEGV in textui_get_command (Android version)

Reported by: david3x3x3 Owned by:
Milestone: 3.3.0 Keywords:
Cc:

Description

The program occasionally crashes when typing "xh" (or examine in another direction) when using rogue keybindings. It seems to happen only when typing quickly. I'll attach a stack dump.

Attachments (1)

stack.txt (7.6 KB) - added by david3x3x3 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by david3x3x3

comment:1 Changed 9 years ago by david3x3x3

Looking at the code, it looks like we need to do something like this. Hopefully someone more experienced than me can validate.

--- cmd0.c.bak  2011-05-18 15:21:06.814120700 -0700
+++ cmd0.c      2011-05-18 15:24:04.782870700 -0700
@@ -562,9 +562,17 @@
                /* Apply keymap if not inside a keymap already */
                if (ke.key.code && act && !inkey_next)
                {
+                       size_t n = 0;
+                       while (act[n].type) {
+                               n++;
+                       }
+
+                       /* Make room for the terminator */
+                       n += 1;
+
                        /* Install the keymap */
                        memcpy(request_command_buffer, act,
-                                 sizeof(request_command_buffer));
+                                 n * sizeof(struct keypress));

                        /* Start using the buffer */
                        inkey_next = request_command_buffer;

comment:2 Changed 9 years ago by david3x3x3

I'm testing this code now. It compiles without error, and I haven't had another crash yet.

comment:3 Changed 9 years ago by takkaria

  • Milestone changed from Triage to 3.3.0
  • Status changed from new to pending

In staging, thanks.

comment:4 Changed 9 years ago by magnate

  • Resolution set to fixed
  • Status changed from pending to closed

In master as of [r72e6029], Sun 22 May 2011.

Note: See TracTickets for help on using tickets.