diff --git a/src/vtestream-file.h b/src/vtestream-file.h
index 5c709b4..ea335bc 100644
--- a/src/vtestream-file.h
+++ b/src/vtestream-file.h
@@ -416,6 +416,8 @@ _vte_file_stream_read (VteStream *astream, gsize offset, char *data, gsize len)
 	VteFileStream *stream = (VteFileStream *) astream;
 	gsize l;
 
+	g_assert (offset + len <= stream->head);
+
 	if (G_UNLIKELY (offset < stream->offset[1]))
 		return FALSE;
 
