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
Do not overflow local buffer #1909
Conversation
Hi @isimluk. Thanks for your PR. I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @isimluk. Thanks for your PR. I'm waiting for a kubernetes-sigs or openshift member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Same as containers/conmon#5 Let me know if there is another project bundling this. |
/test all |
@isimluk: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
LGTM |
cfmt is failing a check with: @@ -1679,7 +1679,7 @@ int main(int argc, char *argv[])
* Read from container stderr for any error and send it to parent
* We send -1 as pid to signal to parent that create container has failed.
*/
- num_read = read(masterfd_stderr, buf, BUF_SIZE -1);
+ num_read = read(masterfd_stderr, buf, BUF_SIZE - 1);
if (num_read > 0) {
buf[num_read] = '\0';
write_sync_fd(sync_pipe_fd, -1, buf);
make: *** [cfmt] Error 1
The command "make fmt" exited with 2. @isimluk can you fix that? |
Do not use full width of buf, as we intend to assign buf[num_read] = '\0'; at the end of the buffer, afterwards. In case we have just read full BUF_SIZE, we will write '\0' to a memory location that is outside of buf. This can be referred to as CWE-119 although, it seems pretty harmless in this case. Signed-off-by: Šimon Lukašík <isimluk@fedoraproject.org>
bbce1b4
to
6d908fb
Compare
/lgtm |
/ok-to-test |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: isimluk, mrunalp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Do not use full width of buf, as we intend to assign
at the end of the buffer, afterwards. In case we have just read full BUF_SIZE,
we will write '\0' to a memory location that is outside of buf. This can be
referred to as CWE-119 although, it seems pretty harmless in this case.
Signed-off-by: Šimon Lukašík isimluk@fedoraproject.org