2 ms·
The double increment itself isn't undefined behavior. Note that the two increments were separated with a semicolon, making them separate statements. It's equiva
by mikeash 9y ago
The double increment itself isn't undefined behavior. Note that the two increments were separated with a semicolon, making them separate statements. It's equivalent to pzs_text += 2;.
The exploit would presumably involve structuring your data so that the excess increment skips over a terminator of some sort. If it's scanning until it hits a zero byte, and you get it to skip over the zero byte, then you have a buffer overflow.
- airza 9y agoAhh, that does make sense, i didn't see that.