-1
votes
0answers
96 views

How many variable/buffer overflows are there in this C programming code?

#include <stdio.h> #include <string.h> #include <limits.h> int main(int argc, char *argv[]) { FILE *fp; char filename[128]; char strings[USHRT_MAX][50]; unsigned short cnt = 0; ...
-1
votes
2answers
52 views

what could go wrong in the following code? [closed]

char* function (char* s) { char buffer[1024]; strcpy(buffer,s); buffer[strlen(s)-1]='\n'; return buffer; } for this function i think there are three things that may fail this code: ...
0
votes
1answer
74 views

Exploiting Buffer Overflow

I have come across a C program which has a buffer overflow flaw. We need to make the program work in our way. As per my understanding overflowing the buffer would overwrite the next memory location. ...
0
votes
0answers
72 views

Jack ringbuffer

I have a problem with jack_ringbuffer, when the jack ringbuffer is full it does not get any more new data. I want to ring bufer when it will release full of old data and new data received. I using ...
-2
votes
5answers
98 views

How to prevent password masking from bufferoverflow

#include <conio.h> #include <windows.h> #include <stdio.h> int main () { char input[255]; int i = 0; for(;;i++) /* Infinite loop, exited when RETURN is pressed */ { char temp; ...
0
votes
2answers
159 views

How to find out the ret address

void function(int a, int b, int c) { char buffer[1]; int *ret; ret = buffer + 20; (*ret) += 7; } void main() { int x; x = 0; function(1, 2, 3); x = 1; ...
0
votes
0answers
76 views

Getting a large amount of data with traceview

I'm running some benchmarks and some overflow the traceview buffer, I'm already using the max buffer size that I can (400MB). How can I get these data? (I need the hole benchmark to be traced, not ...
0
votes
0answers
110 views

Node.js “targetStart out of bounds” error when using buffers

I keep getting this error when writing to buffers on node.js [Error: oob] [Error: targetStart out of bounds] I read here that the "targetStart out of bounds" may occur when trying to manipulate the ...
-2
votes
1answer
153 views

Buffer management in c

i have a buffer sized 2000, the data to be inserted is unlimited. I want, data more than 2000 should be added from the end of the buffer, i.e. push all data from right to left and insert new data at ...
0
votes
0answers
95 views

Buffer Overflow in android tool code

char name[EFI_NAMELEN]; fprintf(stderr,"ptn start block end block name\n"); fprintf(stderr,"---- ------------- ------------- --------------------\n"); for (n = 0; n < EFI_ENTRIES; n++, ...
0
votes
5answers
2k views

How to determine the size of an allocated C buffer?

I have a buffer and want to do a test to see if the buffer has sufficient capacity I.e. find number of elements I can add to the buffer. char *buffer = (char *)malloc(sizeof(char) * 10); Doing a ...
1
vote
1answer
269 views

C overflows need some direction

I have 2 programs that I'm trying to do some stack smashing with. vuln.c #include <stdlib.h> #include <stdio.h> int bof() { char buffer[8]; FILE *badfile; badfile = fopen( ...
2
votes
3answers
160 views

Preventing user to upload too big of a file in perl

Hi guys i have this line of code in a perl script where i allow users to upload a 5 second microphone recording to my server. The flash that does the recording automatically limits the microphone to 5 ...
0
votes
2answers
161 views

setting up system for program debugging buffer overflow

I remember reading a long time ago that if I want to test for buffer overflows on my linux box that I need to set something in the system to allow it to happen. I can't remember exactly what it was ...
0
votes
1answer
124 views

C Buffer overflow Display message (Using Ubuntu and DDD)

#include <stdio.h> #include <stdlib.h> void badf(int n, char c, char* buffer) { int i; for (i=0; i<n; i++) { buffer[i]=c; } } void f(int n, char c) { char ...

1 2
15 30 50 per page