Hello Duncan Laurie,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/em100/+/48587
to review the following change.
Change subject: trace: Handle empty and oversized packets ......................................................................
trace: Handle empty and oversized packets
Signed-off-by: Duncan Laurie dlaurie@google.com Change-Id: I24f5d5973b47652ff1357756d9a01b85c41c1682 --- M trace.c 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/87/48587/1
diff --git a/trace.c b/trace.c index 46b52b2..933575e 100644 --- a/trace.c +++ b/trace.c @@ -193,9 +193,11 @@ for (report = 0; report < REPORT_BUFFER_COUNT; report++) { data = &reportdata[report][0]; count = (data[0] << 8) | data[1]; - if (count > 1022) { + if (!count) + continue; + if (count > 1023) { printf("Warning: EM100pro sends too much data.\n"); - count = 1022; + count = 1023; } for (i = 0; i < count; i++) { unsigned int j = additional_pad_bytes;
Hello Duncan Laurie,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/em100/+/48587
to look at the new patch set (#2).
Change subject: trace: Handle empty and oversized packets ......................................................................
trace: Handle empty and oversized packets
Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Signed-off-by: Duncan Laurie dlaurie@google.com Change-Id: I24f5d5973b47652ff1357756d9a01b85c41c1682 --- M trace.c 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/87/48587/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/em100/+/48587 )
Change subject: trace: Handle empty and oversized packets ......................................................................
Patch Set 2: Code-Review+2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/em100/+/48587 )
Change subject: trace: Handle empty and oversized packets ......................................................................
Patch Set 4: Code-Review+2
Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/em100/+/48587 )
Change subject: trace: Handle empty and oversized packets ......................................................................
trace: Handle empty and oversized packets
Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Signed-off-by: Duncan Laurie dlaurie@google.com Change-Id: I24f5d5973b47652ff1357756d9a01b85c41c1682 Reviewed-on: https://review.coreboot.org/c/em100/+/48587 Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M trace.c 1 file changed, 4 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/trace.c b/trace.c index 7ab2f5c..2afdbad 100644 --- a/trace.c +++ b/trace.c @@ -195,9 +195,11 @@ for (report = 0; report < REPORT_BUFFER_COUNT; report++) { data = &reportdata[report][0]; count = (data[0] << 8) | data[1]; - if (count > 1022) { + if (!count) + continue; + if (count > 1023) { printf("Warning: EM100pro sends too much data.\n"); - count = 1022; + count = 1023; } for (i = 0; i < count; i++) { int address_bytes = 0;