Code: http://paste.pocoo.org/show/422081/ (link is 404 missing).
Alright so I'm trying to NOT generic chunks of memory and decided I was done diddling with unwieldy casts and figured I'd drop down into inline assembly (I think it actually improved readability). I've managed to narrow this segfault to one specific function. It's at line 22 of the paste.
Yet it always segfaults. As you can see, str is passed as argv.
I can manually do stuff to argv (for example
argv = 'q'
Your problem is the
password variable. You allocate just one element and then you do
password++ in the
for loop. So the second time you do the loop you are in nowhere land.
The code shows that you are using much too complicated concepts than you master at the moment.
unsigned charis generally the correct type to inspect individual bytes of an object.