kkireeva at andrew dot cmu.edu
2018-05-23 17:32:42 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=23222
Bug ID: 23222
Summary: Gdb prints the wrong address for local variables, in
32 bit mode
Product: gdb
Version: 7.11.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: exp
Assignee: unassigned at sourceware dot org
Reporter: kkireeva at andrew dot cmu.edu
Target Milestone: ---
I didn't compile the binary myself.
It has no stack protections
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
volatile int modified;
char buffer[64];
modified = 0;
gets(buffer);
if(modified != 0) {
printf("you have changed the 'modified' variable\n");
} else {
printf("Try again?\n");
}
}
The addresses of modified and buffer are printed above argv, which is nonsense.
Also their true location is different, as evidenced by what strcpy modifies.
print &modified
$1 = (volatile int*) 0xffffcf3c
print &argv
$2 = (char***) 0xffffcf64
Bug ID: 23222
Summary: Gdb prints the wrong address for local variables, in
32 bit mode
Product: gdb
Version: 7.11.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: exp
Assignee: unassigned at sourceware dot org
Reporter: kkireeva at andrew dot cmu.edu
Target Milestone: ---
I didn't compile the binary myself.
It has no stack protections
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
volatile int modified;
char buffer[64];
modified = 0;
gets(buffer);
if(modified != 0) {
printf("you have changed the 'modified' variable\n");
} else {
printf("Try again?\n");
}
}
The addresses of modified and buffer are printed above argv, which is nonsense.
Also their true location is different, as evidenced by what strcpy modifies.
print &modified
$1 = (volatile int*) 0xffffcf3c
print &argv
$2 = (char***) 0xffffcf64
--
You are receiving this mail because:
You are on the CC list for the bug.
You are receiving this mail because:
You are on the CC list for the bug.