The wrong way to determine the size of a buffer

Raymond Chen

A colleague of mine showed me some code from a back-end program on a web server. Fortunately, the company that wrote this is out of business. Or at least I hope they’re out of business!

size = 16384;
while (size && IsBadReadPtr(buffer, size)) {
    size--;
}

0 comments

Discussion is closed.

Feedback usabilla icon