Questions tagged [stack-smash]

Stack smashing is a buffer overflow vulnerability which is characterized by writing data outside the size of a stack-allocated buffer, causing corruption of a neighboring stack frame and potentially permitting execution of malicious code. Use this tag for questions about `stack smashing detected` and similar runtime errors, code with vulnerable buffers and other security risks related to stack smashing. See also: [buffer-overflow] and [buffer-overrun].

In software, a stack buffer overflow (also known as stack smashing) occurs when a program writes to a memory address on the program's call stack outside of the intended data structure, which is usually a fixed length buffer. Stack buffer overflow bugs are caused when a program writes more data to a buffer located on the stack than what is actually allocated for that buffer. This almost always results in corruption of adjacent data on the stack, and in cases where the overflow was triggered by mistake, will often cause the program to crash or operate incorrectly. Stack buffer overflow is a type of the more general programming malfunction known as buffer overflow (or buffer overrun).

This tag should be used for questions about stack smashing detected and similar runtime errors, code with vulnerable buffers and other security risks related to stack smashing. See also: and .

161 questions
-1
votes
2 answers

Overwrite value in memory by taking in user input

This is related to a stack smash attack. Basically, I am trying to smash the stack by giving a program a particular input. The program takes in a user input like this, using getchar: for (i = 0; (c = getchar()) != '\n'; i++) buf[i] = c; I want to…
umop apisdn
  • 653
  • 9
  • 20
-1
votes
1 answer

Stack smashed aborted (core dumped) error

I've been working on a project for school , where we've been assigned the task to make Roulette game with 2 clients and a server (TCP). So i figured i'd make a void function for both the server and the client, to realize the communication ,but I…
Gameerik
  • 5
  • 4
-1
votes
1 answer

C++ stack smashing detected error

I am starting a personal project incorporating a linked list in C++ and I get a stack smashing detected error, however the program always runs all the way through. I don't believe the error has to do with the Account class I created, I did some…
Anthony Palumbo
  • 314
  • 1
  • 11
-1
votes
2 answers

Stack smashing error

I am supposed to write a bot which reads web adresses from file and performs a GET request which is writen to a file again. This works so far, but the program always terminates with a "stack smashing error". I work with multiple "consumer" threads,…
Peter L.
  • 3
  • 2
-1
votes
1 answer

stack smashing, cant find overflow error

I'm trying to write a function that will pad a string with some character if the length of the string is less than the max size allocated to the char buffer. I'm encountering a "* stack smashing detected *: ./test terminated" error which halts my…
tovry
  • 1
  • 2
-1
votes
1 answer

I keep getting the error "stack smashing detected"

I'm programming in C and compiling with gcc. Every time I compile I get a stack smashing detected error. What does this mean and how can I fix it? #include #define MAX_ARRAY 50 static int getScore(int assignmentNum[], int weight[], int…
user2823747
  • 67
  • 2
  • 3
  • 10
-1
votes
2 answers

Stack Smashing Detected. C programming

i'm trying to run a C program. It seems to work fine, but at the end it shows: STACK SMASHING DETECTED This is the code: #include #include #include #include #include extern int errno; int…
-2
votes
1 answer

Integer Overflow Exploit

I have this code, which have some vulnerability, but I can't seem to exploit it. For now, this is what I've noticed: 1) if argv[1] = 3 and argc = 3, then it overflows and writes argv[2] into memory of array[3] in "place_int_array" function. 2) if…
Elyasaf755
  • 2,239
  • 18
  • 24
-2
votes
1 answer

stack smashing terminates program

I am learning C++ and was given the task to create a program that allows user to modify an array with 10 integers in it. if user gives an index out of range program will exit. Program works with negative numbers and all numbers with in the range.…
-2
votes
1 answer

Stack smashing detected C++. Solving Laplace equation

I am solving the Laplace equation using C++. I am solving for P, the pressure field. In my code, you can see below, P is a function of both x and y. I declared it as a 2d array of length nx and ny. The final matrix result, P, I got, is correct. …
mle0312
  • 365
  • 5
  • 17
-4
votes
1 answer

Stack Smashing when returning pointer to array

my function neldermead looks like this: double * neldermead (double data[], double (*function)(int, double, double, double, double, double), double ia1, double ia2, double ia3, double ia4, double ia5, double rad, int k) { ... printf("8\n"); double…
BostonBrooks
  • 105
  • 1
  • 6
1 2 3
10
11