Skip to content

Add error status in ZFile::BlockReader#230

Merged
liulanzheng merged 1 commit intocontainerd:mainfrom
BigVan:zfile_br_eno
Jun 19, 2023
Merged

Add error status in ZFile::BlockReader#230
liulanzheng merged 1 commit intocontainerd:mainfrom
BigVan:zfile_br_eno

Conversation

@BigVan
Copy link
Member

@BigVan BigVan commented Jun 16, 2023

What this PR does / why we need it:

Add return value check for Zfile::BlockReader to avoid getting invalid data in ZFile::pread.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

@BigVan BigVan force-pushed the zfile_br_eno branch 2 times, most recently from 6b47f18 to e1fe2b1 Compare June 16, 2023 10:17
}
m_reader->m_begin_idx = m_reader->m_idx;
}
get_current_block();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goto end if not return 0 ?

Signed-off-by: Yifan Yuan <tuji.yyf@alibaba-inc.com>
Copy link
Contributor

@yuchen0cc yuchen0cc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@liulanzheng liulanzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liulanzheng liulanzheng merged commit 9a6d5ef into containerd:main Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants