Avoiding buffer length checks before buffer access in C++ -


i have char* buffer need decode db. buffer such if not null, it's big , contains integers , strings.

the buffer contain contents 4-byte integer length followed ascii string many characters long. it's followed 4-byte length , string of length, , on until reach end.

most of time buffer valid see buffer corrupted , segv. segv since length resulted in reading more bytes rest of buffer length.

i do not want put checks everywhere remaining buffer length before decoding. buffer fields 200 in number. check can provide here can me solve problem without overhead of if checks?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -