[Mono-dev] [PATCH] Perform bounds check on table decode

Rodrigo Kumpera kumpera at gmail.com
Sun Dec 30 16:58:07 EST 2007


The attached patch adds an assert in both mono_metadata_decode_row(_col). I
think it's better to assert than access random data.

On the other hard, functions that decode metadata tables must perform such
checks and raise the apropriate error. The attached patch fixes that for
mono_get_method_from_token, which is what I have tests for now. Most of this
bounds checking could be done in mono_method_to_ir, which would avoid
tripping into the metadata stuff.

Just one thing, the test requires that my previous patch to ilasm be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071230/918e9fd3/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: token_bounds_check.diff
Type: text/x-patch
Size: 932 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071230/918e9fd3/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invalid_ldftn_invalid_token_out_of_bounds.il
Type: text/x-msil
Size: 794 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071230/918e9fd3/attachment-0001.bin 

More information about the Mono-devel-list mailing list