Skip to content

Fix integer overflow in parseOption().#17352

Merged
alalek merged 3 commits intoopencv:3.4from
egorpugin:patch-2
May 25, 2020
Merged

Fix integer overflow in parseOption().#17352
alalek merged 3 commits intoopencv:3.4from
egorpugin:patch-2

Conversation

@egorpugin
Copy link
Copy Markdown
Contributor

@egorpugin egorpugin commented May 22, 2020

Previous code does not work for values like 100000MB.
The overflow itself is in line return v * 1024 * 1024;.

Pull Request Readiness Checklist

  • I agree to contribute to the project under OpenCV (BSD) License.

@alalek
Copy link
Copy Markdown
Member

alalek commented May 24, 2020

Thank you for contribution!

As a bugfix this patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@egorpugin egorpugin changed the base branch from master to 3.4 May 24, 2020 09:48
@egorpugin
Copy link
Copy Markdown
Contributor Author

Done.

@asmorkalov asmorkalov requested a review from alalek May 25, 2020 07:29
@asmorkalov
Copy link
Copy Markdown
Contributor

@egorpugin Please pay attention on CI status. Linux build failed with error:

/build/precommit_linux64/3.4/opencv/modules/core/src/system.cpp:1964:46: error: 'stoull' is not a member of 'std'

@asmorkalov
Copy link
Copy Markdown
Contributor

OpenCV 3.4 branch is build without C++11 by default, but new functions were added in C++11. @alalek Do we need different solutions for 3.4 and master then?

@egorpugin
Copy link
Copy Markdown
Contributor Author

I won't be contributing different version for older opencv. Apply to master or whatever you want.

@asmorkalov asmorkalov self-requested a review May 25, 2020 13:54
@alalek alalek merged commit 1bec7ca into opencv:3.4 May 25, 2020
@egorpugin egorpugin deleted the patch-2 branch May 25, 2020 20:35
@alalek alalek mentioned this pull request May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants