i built a compression lib in cpp
(github.com)
from phpinjected@lemmy.sdf.org to programming@programming.dev on 18 Jun 2024 09:13
https://lemmy.sdf.org/post/18380262
from phpinjected@lemmy.sdf.org to programming@programming.dev on 18 Jun 2024 09:13
https://lemmy.sdf.org/post/18380262
threaded - newest
sh
is for shell.Bad name.
Does it compress from the middle out?
.
This guy develops on windows
For a little bit I thought this library might be a subtle joke, seeing the
#define _SHITPRESS_H
at the start. That combined with thecompress()
anddecompress()
not taking any arguments and not having a return value, I thought we were being played. Not to mention the library appears to be plain C rather than C++… surely the author should know the difference?Then I saw how the interface actually works:
This seems extremely poorly thought out. Calling into global functions for input and output means that your library will be a pain to use in any program that has to (de)compress anything more than a single input.
You have stack buffer out of bounds write. On line
52
you declareh
an array of70
unsigned int
s. On line57
you store reference to such array. Later, on line35
you write out of bounds, one element past end of the array. The_SPR_history[i]
writes to_SPR_history[70]
. Created an issue: github.com/X64X2/sh/issues/1