Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: runtime/bin/filter.cc

Issue 1393013002: Ensure ZILB encoder handles all typed data lists correctly (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Addressed review comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/io/data_transformer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/filter.cc
diff --git a/runtime/bin/filter.cc b/runtime/bin/filter.cc
index f537606609fb41a3a270e1358dde709ba0ff28a4..5e87f62a599d6f17d4727760511fba1cb19f04e0 100644
--- a/runtime/bin/filter.cc
+++ b/runtime/bin/filter.cc
@@ -154,7 +154,14 @@ void FUNCTION_NAME(Filter_Process)(Dart_NativeArguments args) {
uint8_t* buffer = NULL;
Dart_Handle result = Dart_TypedDataAcquireData(
data_obj, &type, reinterpret_cast<void**>(&buffer), &length);
+
if (!Dart_IsError(result)) {
+ ASSERT(type == Dart_TypedData_kUint8 || type == Dart_TypedData_kInt8);
+ if (type != Dart_TypedData_kUint8 && type != Dart_TypedData_kInt8) {
+ Dart_TypedDataReleaseData(data_obj);
+ Dart_ThrowException(DartUtils::NewInternalError(
+ "Invalid argument passed to Filter_Process"));
+ }
uint8_t* zlib_buffer = new uint8_t[chunk_length];
if (zlib_buffer == NULL) {
Dart_TypedDataReleaseData(data_obj);
« no previous file with comments | « no previous file | sdk/lib/io/data_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698