Skip to content
Permalink
Browse files Browse the repository at this point in the history
Throw on skipping an invalid type.
Summary:
Certain values (e.g.) T_STOP should not appear as a skip type. Allowing them to
can cause thrift to loop unboundedly.

Reviewed By: spalamarchuk

Differential Revision: D15102451

fbshipit-source-id: c08d52f44f37e9c212d3480233ac217105586c9f
  • Loading branch information
davidtgoldblatt authored and facebook-github-bot committed May 3, 2019
1 parent 247af60 commit 01686e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions thrift/lib/cpp/protocol/TProtocol.h
Expand Up @@ -165,8 +165,9 @@ uint32_t skip(Protocol_& prot, TType arg_type) {
result += prot.readListEnd();
return result;
}
default:
return 0;
default: {
TProtocolException::throwInvalidSkipType(arg_type);
}
}
}

Expand Down

0 comments on commit 01686e1

Please sign in to comment.