Fix decode_bmp crash by adding length check before reading the data in buffer by yongtang · Pull Request #14967 · tensorflow/tensorflow · GitHub
Skip to content

Fix decode_bmp crash by adding length check before reading the data in buffer#14967

Merged
sb2nov merged 6 commits into
tensorflow:masterfrom
yongtang:14959-decode_bmp-file-size
Nov 30, 2017
Merged

Fix decode_bmp crash by adding length check before reading the data in buffer#14967
sb2nov merged 6 commits into
tensorflow:masterfrom
yongtang:14959-decode_bmp-file-size

Conversation

@yongtang

Copy link
Copy Markdown
Member

This fix tries to address the issue raised in #14959 where the bmp content length was not checked before reading the buffer. As a result, decode_bmp might trigger a crash if the content of bmp is incomplete.

This fix fixes the issue by adding the needed check before reading the data.

Additional test cases have been added.

This fix fixes #14959.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

…n buffer

This fix tries to address the issue raised in 14959 where
the bmp content length was not checked before reading the buffer.
As a result, decode_bmp might trigger a crash if the content of bmp
is incomplete.

This fix fixes the issue by adding the needed check before
reading the data.

This fix fixes 14959.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@sb2nov sb2nov self-assigned this Nov 30, 2017
@sb2nov sb2nov added awaiting testing (then merge) and removed awaiting review Pull request awaiting review labels Nov 30, 2017
@sb2nov sb2nov merged commit 4cc4d53 into tensorflow:master Nov 30, 2017
@yongtang yongtang deleted the 14959-decode_bmp-file-size branch November 30, 2017 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]Out-of-Bounds Read in DecodeBmpOp class(tensorflow/core/kernels/decode_bmp_op.cc)

4 participants