-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor build system #8
Conversation
4d977f5
to
c8090ad
Compare
See intentional buffer overflow in action. |
I'll look at this closely along with helium/erlang-h3#14 on Tuesday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one significant comment regarding a calloc.
c_src/erasure.c
Outdated
@@ -67,7 +67,7 @@ encode(ErlNifEnv * env, int argc, const ERL_NIF_TERM argv[]) | |||
int bytes_per_shard = input.size / k; | |||
int extra_bytes = input.size % k; | |||
|
|||
char *shards = calloc(k+m, blockspacing); | |||
char *shards = calloc(k+m, blockspacing-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? An off by one error?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added that on purpose to trigger an error. I'll rebase without that commit before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to see it working.
1. switch to cmake for better control of build 2. add compile-time static-analysis 3. add support for santization
See helium/erlang-h3#14 for more details, as this PR is pretty much identical.