More checks in ELF parser.

Hello, I'm working on the radare2 ELF parser.

I found many bugs on it due to lack of checks on ELF structure fields, which result to segfault (or more 3vil things...).

If you are interested, I'm rewriting the parser (partialy) in the goal to made it more secure and more robust.

Here is the first patch I submit, but there are still bugs, and I need to rewrite other functions.

If you have question on my code, I'm open to discussion ;)

-TOSH-
i would suggest removing all those functions and make them static inline functions in r_types.h like this:

static inline int UT32_ADD(ut32 *r, ut32 a, ut32 b) { ... }

Another option would be to define a macro instead of using static inline, 

#define ADDut64(r,a,b) ((UT64_MAX-a)<b)?0:r?*r=a+b:1:1