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

Unified Diff: runtime/bin/socket_impl.dart

Issue 10996058: Fix errors caused by missing argument checking (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_impl.dart
diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_impl.dart
index 3cd2c770f1cc6a8b7de41ace2b18d256f6beb8f4..08f24d01937210c1a58fa80d1131bf6cfbb8c9b8 100644
--- a/runtime/bin/socket_impl.dart
+++ b/runtime/bin/socket_impl.dart
@@ -391,6 +391,10 @@ class _Socket extends _SocketBase implements Socket {
_readList(List<int> buffer, int offset, int bytes) native "Socket_ReadList";
int writeList(List<int> buffer, int offset, int bytes) {
+ if (buffer is! List || offset is! int || bytes is! int) {
+ throw new ArgumentError(
+ "Invalid arguments to writeList on Socket");
+ }
if (!_closed) {
if (bytes == 0) {
return 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698