3 ms·
mm_set in memory.c won't actually do what you want, the asm statement needs fixing and it can be implemented in terms of memset.
by nwmcsween 9y ago
mm_set in memory.c won't actually do what you want, the asm statement needs fixing and it can be implemented in terms of memset.
- ladarlevison 9y agomm_set is being used. As I recall that pattern was inspired by looking at a libc implementation for memset. The combination of using volatile and the asm("") statements keep the compiler from optimizing away what it thinks are unnecessary memset (like a wipe operation). It's possible that solution doesn't work on every system though. So, how would you improve it?
- nwmcsween 9y agohttp://www.5starstandard.ca/projects/myosin/myosin/string/memsset.c http://www.5starstandard.ca/projects/myosin/myosin/string/me... Basically just the right inline asm. But the project as a whole is a bit of a mess, multiple 'memssets' will not do anything to make things more secure than just one.
- sillysaurus3 9y agoIs it used anywhere? Whenever I find an obvious bug in a large codebase, it's usually in a section that turns out not to be used. Or used in a section that isn't itself used anywhere, etc.