You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by "Quanlong Huang (JIRA)" <ji...@apache.org> on 2018/09/16 02:18:00 UTC
[jira] [Updated] (ORC-403) Should check offsets got from protobuf
Objects
[ https://issues.apache.org/jira/browse/ORC-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Quanlong Huang updated ORC-403:
-------------------------------
Description:
A malformed ORC file may have a postscript length larger than the file size, which causes orc:: readPostscript to read unexpected data.
{code:java}
std::unique_ptr<proto::PostScript> postscript =
std::unique_ptr<proto::PostScript>(new proto::PostScript());
if (!postscript->ParseFromArray(ptr + readSize - 1 - postscriptSize,
static_cast<int>(postscriptSize))) {
throw ParseError("Failed to parse the postscript from " +
stream->getName());
}
{code}
We should make sure readSize - 1 - postscriptSize >= 0. Furthermore, we should check offsets and lengths got from protobuf Objects.
was:
A malformed ORC file may have a postscript length larger than the file size, which causes orc:: readPostscript to read unexpected data.
{code}
std::unique_ptr<proto::PostScript> postscript =
std::unique_ptr<proto::PostScript>(new proto::PostScript());
if (!postscript->ParseFromArray(ptr + readSize - 1 - postscriptSize,
static_cast<int>(postscriptSize))) {
throw ParseError("Failed to parse the postscript from " +
stream->getName());
}
{code}
We should make sure readSize - 1 - postscriptSize >= 0.
Summary: Should check offsets got from protobuf Objects (was: Should check PostScript length before serializing it)
> Should check offsets got from protobuf Objects
> ----------------------------------------------
>
> Key: ORC-403
> URL: https://issues.apache.org/jira/browse/ORC-403
> Project: ORC
> Issue Type: Bug
> Components: C++
> Reporter: Quanlong Huang
> Assignee: Quanlong Huang
> Priority: Major
> Attachments: bad_stripe_info.orc, copy7_000000_0
>
>
> A malformed ORC file may have a postscript length larger than the file size, which causes orc:: readPostscript to read unexpected data.
> {code:java}
> std::unique_ptr<proto::PostScript> postscript =
> std::unique_ptr<proto::PostScript>(new proto::PostScript());
> if (!postscript->ParseFromArray(ptr + readSize - 1 - postscriptSize,
> static_cast<int>(postscriptSize))) {
> throw ParseError("Failed to parse the postscript from " +
> stream->getName());
> }
> {code}
> We should make sure readSize - 1 - postscriptSize >= 0. Furthermore, we should check offsets and lengths got from protobuf Objects.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)