-
Notifications
You must be signed in to change notification settings - Fork 70
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
SAS dataset label #213
SAS dataset label #213
Conversation
&ctx->text_blobs[0][off], | ||
ctx->col_info[0].name_ref.offset - off | ||
); | ||
} |
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 think additional pointer validation is necessary here. We need to ensure:
- The first
memcmp
does not overruntext_blob_lengths[0]
off
is not larger thanctx->col_info[0].name_ref.offset
ctx->file_label
is not overrun during thememcpy
Additionally: file_label
likely needs to be recoded. So I suggest using readstat_convert
here instead of the memcpy
. That will automatically solve the third issue. Something like
readstat_convert(ctx->file_label, sizeof(ctx->file_label),
&ctx->text_blobs[0][off], ctx->col_info[0].name_ref.offset - off, ctx->converter)
Then check the return value.
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.
Should be addressed with the last commit
In addition to the name of a SAS dataset also its label is read in from sas7bdat and printed the dataset's metadata is listed.