18 karma · joined Dec 24, 2017 (8y ago) · 3 submissions
comment 8y ago · link · parent
For example, I don't think your getorder() could possibly be faster than __builtin_ctz(), or even a wrapper around ffs(). You also hardcoded the size of size_t to 32 bits, so it's not more portable than those options.
Edit: I checked, ffs is a tiny branch-free routine in glibc:
(gdb) disassemble ffs
Dump of assembler code for function ffsl:
0x0007e9d0 <+0>: mov $0xffffffff,%edx
0x0007e9d5 <+5>: bsf 0x4(%esp),%eax
0x0007e9da <+10>: cmove %edx,%eax
0x0007e9dd <+13>: add $0x1,%eax
0x0007e9e0 <+16>: ret
End of assembler dump.comment 8y ago · link · parent
I think there is more to this story, it sounds like this wasn't a "Cross Site Scripting", but "Content Injection" or "Content Spoofing", a far less serious bug.
You're gonna hate me, but I would award $0 for Content Injection, it's just not a big deal ¯\_(ツ)_/¯