Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "heap corruption"
assignment: use winAPI to create a "virus" that put itself in autorun and does nothing.
me, a curious student: does the assignment and adds a heap corruption code just as a joke.
after sending the assignment to the teacher I realized that I have sent the real virus.
result: teacher comes next lesson without a computer and stares at me silently and viciously.
we'll see what happens next
any idea on what's going on in his head?30
I am working on an open source game project, and the most common way to draw things is using a class named ManagedSurface. The class is otherwise awesome, but it has a method called getBasePtr(x, y), which gives you a pointer to the requested coordinates. Fair enough (this is C++ without STL by the way).
But WHY THE HELL CAN I REQUEST ANY POINTER THAT I WANT, EVEN IF IT'S OUTSIDE THE SURFACE? Other cointainers have sanity checks, asserts and such, and the surface KEEPS TRACK OF IT'S WIDTH AND HEIGHT.
WAS IT SO FUCKING HARD TO ADD assert(x <= w); assert(y <= h);???
I spent 3 days on valgrind trying to find a heap corruption that manifested at random points in the code.
On the bright side, I learned how to use valgrind (which is awesomely awesome).4
Starting the Monday with a good old heap corruption in a c# project that uses only managed code.
Occurs on 2/3 PCs.
Today is going to productive :/