Repository navigation
Update a couple of functions to know buffer length #121
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -306,8 +306,8 @@ NI2_API int fill_hdr2_field_array(field_s * nh_fields); | |
| NI2_API int fill_nim1_field_array(field_s * nim_fields); | ||
| NI2_API int fill_nim2_field_array(field_s * nim_fields); | ||
| NI2_API int fill_ana_field_array(field_s * ah_fields); | ||
| NI2_API int modify_all_fields(void *basep, nt_opts *opts, field_s *fields, int flen); | ||
| NI2_API int modify_field (void * basep, field_s * field, const char * data); | ||
| NI2_API int modify_all_fields(void *basep, size_t baseplen, nt_opts *opts, field_s *fields, int flen); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Google Carbon] Minor naming nit: the headers ( |
||
| NI2_API int modify_field (void * basep, size_t baseplen, field_s * field, const char * data); | ||
| NI2_API int process_opts (int argc, const char * argv[], nt_opts * opts); | ||
| NI2_API int remove_ext_list (nifti_image * nim, const char ** elist, int len); | ||
| NI2_API int usage (const char * prog, int level); | ||
|
|
||
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.
[Google Carbon] Non-blocking defensive nit (here and in
niftilib/nifti1_tool.c:2917-2918):field->size < 0tofield->size <= 0(every validNT_DT_*field has positive element size).sizeof(size_t) == 4),(size_t)field->offset + (size_t)field->size * (size_t)field->lencan wrap modulo2^32if a caller passes a malformedfield_swith hugelen/offset. Writing:is 100% overflow-free on both 32-bit and 64-bit.