Skip to content
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

Prevent an OOB read in expand_dims.cc #51013

Merged
merged 1 commit into from Jul 30, 2021

Conversation

geetachavan1
Copy link
Contributor

The for loop that follows this check assumes that axis is between 0 and input_dims.size. If user supplied axis is negative, the if code before this check is supposed to bring it back to positive (similar to how in Python one can do l[-3] to mean l[-3 + len(l)]).

PiperOrigin-RevId: 387200206
Change-Id: I162f4feba12d547c3a4340833ae682016a2ebfab

The for loop that follows this check assumes that `axis` is between `0` and `input_dims.size`. If user supplied `axis` is negative, the if code before this check is supposed to bring it back to positive (similar to how in Python one can do `l[-3]` to mean `l[-3 + len(l)]`).

PiperOrigin-RevId: 387200206
Change-Id: I162f4feba12d547c3a4340833ae682016a2ebfab
@google-cla google-cla bot added the cla: yes label Jul 28, 2021
@gbaned gbaned self-assigned this Jul 29, 2021
@gbaned gbaned added comp:lite TF Lite related issues size:XS CL Change Size: Extra Small labels Jul 29, 2021
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Jul 29, 2021
@gbaned gbaned assigned mihaimaruseac and unassigned gbaned Jul 29, 2021
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jul 30, 2021
@mihaimaruseac mihaimaruseac merged commit af09772 into tensorflow:r2.6 Jul 30, 2021
PR Queue automation moved this from Approved by Reviewer to Merged Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:lite TF Lite related issues size:XS CL Change Size: Extra Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

3 participants