neko icon indicating copy to clipboard operation
neko copied to clipboard

std libs new make_sha1

Open btiffin opened this issue 7 years ago • 3 comments

In libs/std/md5.c

        sha1_init(&ctx);
        sha1_update(&ctx,(unsigned char*)val_string(l)+pp,ll);
        sha1_final(&ctx,result);

val_string(l) should be val_string(s).

The exposed $loader.loadprim("std@make_sha1", 3) giving make_sha1(msg, pos, len) catchs a segfault from the primitive. using l length as the expected string buffer.

btiffin avatar Oct 27 '18 21:10 btiffin

That makes sense since l is an int and s is the only string. You can submit a PR with the fix.

ppenzin avatar Oct 28 '18 15:10 ppenzin

This hasn't been updated in a while. I made the changes and submitted a PR for this #194 .

kuesa avatar Feb 15 '19 01:02 kuesa

Thanks, @kuesa. Maybe more of these external signs of interest will persuade the core Haxe team to pay some attention to Neko, once they get 4.0 rolling out and about. I'm looking forward to HashLink, but NekoVM is some pretty nice code. Hopefully the Neko bridge isn't destined for burning. Wood covered bridges can last for 100 years, even when neglected. :-)

btiffin avatar Mar 04 '19 22:03 btiffin

Was fixed in #194

tobil4sk avatar Mar 27 '23 16:03 tobil4sk