The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
160 views

Which is better: for valid buffer length?

This is a basic question. But, I think understanding this would be helpful to play with buffers in 'C'. Thanks. Scenario Just a sample snippet char *test_buff = (char *) malloc(512); //allocate 512 ...
2
votes
3answers
112 views

Efficiently “moving” data upward through a communication stack

I have implemented an application protocol stack that moves an incoming stream of data upward through several layers, as follows: copies a TCP segment from an OS buffer to my_buffer. after ...
2
votes
4answers
1k views

Is using a bigger buffer useful?

I use buffer for quite a long time when I need to copy a stream or read a file. And every time I set my buffer size to 2048 or 1024, but from my point of view a buffer is like a "bucket" which ...
21
votes
9answers
2k views

Why is it so difficult to make C less prone to buffer overflows?

I'm doing a course in college, where one of the labs is to perform buffer overflow exploits on code they give us. This ranges from simple exploits like changing the return address for a function on a ...
4
votes
2answers
393 views

Data Structures: What are some common examples of problems where “buffers” come into action?

I was just wondering if there were some "standard" examples that everyone uses as a basis for explaining the nature of a problem that requires the use of a buffer. What are some well-known problems in ...