-
Notifications
You must be signed in to change notification settings - Fork 42
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
libkmod: Improve strbuf handling in libkmod-index.c #152
Conversation
... and fixed a typo while at it. |
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.
Food for thought : If we're willing to live with a small hack, we can fold have a single index_mm_node
and index_node_f
alongside a bunch of the helpers.index_node
struct instead of mm
and f
variants, which will allow us to also de-duplicate the helpers.
This PR looks good though.
abfbcb2
to
8e014fc
Compare
The unsigned int data type might be too small on 64 bit systems and when encountering huge and illegal index files. Since lengths are retrieved from strbuf structs, this also keeps the data type lengths in sync. Signed-off-by: Tobias Stoeckmann <[email protected]>
The strbuf functions may fail, so handle errors. Make especially sure that push and pop operations stay in sync. Signed-off-by: Tobias Stoeckmann <[email protected]>
Signed-off-by: Tobias Stoeckmann <[email protected]>
8e014fc
to
26d31ed
Compare
The unsigned int data type might be too small on 64 bit systems and when encountering huge and illegal index files. Since lengths are retrieved from strbuf structs, this also keeps the data type lengths in sync. Signed-off-by: Tobias Stoeckmann <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Link: #152 Signed-off-by: Lucas De Marchi <[email protected]>
The strbuf functions may fail, so handle errors. Make especially sure that push and pop operations stay in sync. Signed-off-by: Tobias Stoeckmann <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Link: #152 Signed-off-by: Lucas De Marchi <[email protected]>
Signed-off-by: Tobias Stoeckmann <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Link: #152 Signed-off-by: Lucas De Marchi <[email protected]>
Applied, thanks. |
unsigned int
lengths intosize_t
to stay in sync with latest strbuf changes