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

Unified Diff: sdk/lib/io/http_impl.dart

Issue 11447013: Correctly handle optional length in HTTP output stream writeFrom (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | tests/standalone/io/regress_7097_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 5539f3adb92b29bf49eb70840d19d4d080c7c5ef..7f701ab143df3024df94c0aaa671182412098a2a 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -683,6 +683,9 @@ class _HttpOutputStream extends _BaseOutputStream implements OutputStream {
}
bool writeFrom(List<int> buffer, [int offset = 0, int len]) {
+ if (offset < 0 || offset >= buffer.length) throw new ArgumentError();
+ len = len != null ? len : buffer.length - offset;
+ if (len < 0) throw new ArgumentError();
return _requestOrResponse._streamWriteFrom(buffer, offset, len);
}
« no previous file with comments | « no previous file | tests/standalone/io/regress_7097_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698