163 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
3
answers
127
views
Stack Smashing with strtol
I'm trying to learn about C and how to use its functions, etc. The man pages suggested to use strtol instead of atoi, so I came up with this code which works without issues:
#include <stdio.h>
#...
1
vote
1
answer
75
views
stack smashing detected and and with the flag -Wall gives me the Warning -Wchar-subscripts
it s my first program ever i dont know how to solve this problems i'm searching for tutorials but i don't totally understand what i am doing wrong.
void railFenceCipher(char *stringa){
char ...
-1
votes
1
answer
230
views
C++ stack smashing detected when returning from a function
I have the following function, which works fine and produces the expected output, but right upon returning, it produces
*** stack smashing detected ***: <unknown> terminated
Aborted (core dumped)...
0
votes
1
answer
649
views
Why do I get a "stack smashing detected" error unless I store the file descriptors?
I'm playing around with a few I/O system calls: Read 2 bytes from an existing file, place them in a buffer, and then write those bytes to another empty, existing file.
// read_write.c
int open(char *...
2
votes
2
answers
172
views
Why does referencing this char array cause Stack smashing, using C?
The program takes a pointer to a char array and an int. The char array consists of two numbers, separated by a space.
The use of the function is to read the values of the char array as integers and ...
0
votes
0
answers
102
views
Buffer Overflow with structures - C
I am a beginner with programming and I have no idea how to fix my code. I want every students[i] to have the overall variable preset with the characters "none". Every way I have tried to ...
1
vote
2
answers
171
views
strtok() sometimes(??) causing stack smashing?
Using Kubuntu 22.04 LTS, Kate v22.04.3, and gcc v11.3.0, I have developed a small program to investigate the use of strtok() for tokenising strings, which is shown below.
#include <stdio.h>
#...
0
votes
1
answer
645
views
***stack smashing detected***
When i run my code on windows (CodeBlocks) everything works but when i run in on Linux it says stack smashing detected and doesnt print anything but the board;
Here ius the code:
#include <stdio.h&...
0
votes
0
answers
82
views
How to implement stack smashing protection in Blazor
A client is asking that we follow their security standards and implement stack smashing protection (SSP) in the in-house (i.e. intranet) Blazor apps that we are developing for them. (Working with VS ...
user avatar
user8149311
1
vote
0
answers
79
views
What is causing the *** stack smashing detected *** error and how can i resolve it? [duplicate]
i'm writing a function that gets passed an array of length 100, full of random integers between 0 and 25 (to be specific the data type is double, but the numbers themselves are whole numbers), that ...
0
votes
1
answer
43
views
Wrong output with scanf function
so this is supposedly not a difficult question, but I've been getting this problem a few times when running my code in VS code. I am trying to separate the alphabets and numbers from the string, and I ...
0
votes
2
answers
991
views
Stack smashing detected
#include <iostream>
using namespace std;
int main()
{
int tablica[9];
string inputromanum;
cout << "ROMAN: ";
cin >> inputromanum;
int maxindeks;
...
3
votes
1
answer
227
views
why stack overflow attacks (modifying the returning address of a function call) caused segmentation fault in `_int_malloc`
I'm learning the structure of stack frames. And trying to implement a function that can call another function without an explicit call in C by modifying the returning address (in its stack frame) of ...
0
votes
1
answer
34
views
solutions for stack overflow using functions in C?
the following code gives me a stack overflow error and I can't seem to find why.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype....
0
votes
0
answers
57
views
Character array size check for stack smashing
In the code below, I'm attempting to concatenate 2 strings: str1 and str2 using strcat from string.h
Since the length of destination string, str1 is 6 bytes on the stack, I expect any store of a ...