Post Reply 
x11-calc Updated
05-04-2024, 08:06 AM (This post was last modified: 05-04-2024 08:08 AM by Thomas Klemm.)
Post: #18
RE: x11-calc Updated
I wondered why i_ticks was set to 0.
Thus I set a watch on that variable.

It turned out that it is set here in src/x11-calc-35.c:
Code:
void v_init_switches(oswitch *h_switch[]) /* Define the switches. */
{
   h_switch[0] = h_switch_create(00000, "OFF", "", "ON ", h_alternate_font, KBD_LEFT, KBD_TOP, 2 * KEY_WIDTH + KEY_GAP, SWITCH_HEIGHT, True, MID_GREY, DARK_GREY);
   h_switch[1] = NULL;
}

Both i_ticks and h_switch are defined here in src/x11-calc.c:
Code:
   int i_ticks = -1;

#if defined(SWITCHES)
   oswitch *h_switch[SWITCHES];
#endif

However in src/x11-calc-35.h the following is defined:
Code:
#define SWITCHES           1

That's the reason that both h_switch[1] and i_ticks point to the same memory location 0x000000016fdfef70 and thus i_ticks gets overwritten.

After removing the spurious line the classic models could be started successfully.
Find attached the output of the debugging session.


Attached File(s)
.zip  buffer-overwrite-x11-calc-35.zip (Size: 1.05 KB / Downloads: 2)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
x11-calc Updated - Mike T. - 04-30-2024, 10:34 PM
RE: x11-calc Updated - Thomas Klemm - 05-01-2024, 10:44 AM
RE: x11-calc Updated - Mike T. - 05-01-2024, 10:37 PM
RE: x11-calc Updated - rncgray - 05-02-2024, 07:18 AM
RE: x11-calc Updated - macmpi - 05-03-2024, 06:45 AM
RE: x11-calc Updated - Mike T. - 05-03-2024, 10:39 PM
RE: x11-calc Updated - Thomas Klemm - 05-02-2024, 07:28 AM
RE: x11-calc Updated - Mike T. - 05-02-2024, 08:02 PM
RE: x11-calc Updated - Mike T. - 05-02-2024, 08:22 PM
RE: x11-calc Updated - Thomas Klemm - 05-02-2024, 10:02 PM
RE: x11-calc Updated - Mike T. - 05-02-2024, 11:25 PM
RE: x11-calc Updated - Thomas Klemm - 05-03-2024, 04:26 PM
RE: x11-calc Updated - Mike T. - 05-03-2024, 10:45 PM
RE: x11-calc Updated - Thomas Klemm - 05-03-2024, 04:45 PM
RE: x11-calc Updated - Mike T. - 05-03-2024, 11:19 PM
RE: x11-calc Updated - Thomas Klemm - 05-03-2024, 06:38 PM
RE: x11-calc Updated - Mike T. - 05-03-2024, 11:47 PM
RE: x11-calc Updated - Thomas Klemm - 05-04-2024 08:06 AM
RE: x11-calc Updated - Mike T. - 05-04-2024, 01:58 PM
RE: x11-calc Updated - Thomas Klemm - 05-04-2024, 08:37 AM
RE: x11-calc Updated - Mike T. - 05-04-2024, 02:27 PM
RE: x11-calc Updated - Thomas Klemm - 05-04-2024, 03:30 PM



User(s) browsing this thread: 12 Guest(s)