fix undefined-shift in block_filter
Needs ReviewPublic

Authored by ltx on Jun 12 2020, 5:18 AM.

Details

Reviewers
None
Group Reviewers
gnupg
Maniphest Tasks
T4975: undefined-shift in block_filter
Summary

force to 'size_t' before shift

* common/iobuf.c (block_filter): add size_t.
  • Signed-off-by: lutianxiong <lutianxiong@huawei.com>
Test Plan
  1. make check
  2. run oss-fuzz

Diff Detail

Repository
rG GnuPG
Lint
Lint Skipped
Unit
Unit Tests Skipped
ltx created this revision.Jun 12 2020, 5:18 AM
ltx edited the summary of this revision. (Show Details)Jun 12 2020, 5:24 AM
ltx edited the test plan for this revision. (Show Details)
ltx edited the summary of this revision. (Show Details)
ltx edited the test plan for this revision. (Show Details)
gniibe added a subscriber: gniibe.Fri, Jul 10, 4:26 AM

Thanks for the patch.
I see your point in T4975: undefined-shift in block_filter.
You are right that we have a problem of possible overflow (which could be kicked by fuzzing) here.
(The actual impact would be small, though).