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

Unified Diff: src/ots.cc

Issue 427014: Fix a test tool for OTS, ot-sanitise.... (Closed) Base URL: http://ots.googlecode.com/svn/trunk/
Patch Set: '' Created 11 years, 1 month 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 | test/file-stream.h » ('j') | test/file-stream.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ots.cc
===================================================================
--- src/ots.cc (revision 10)
+++ src/ots.cc (working copy)
@@ -358,6 +358,11 @@
}
const size_t end_offset = output->Tell();
+ if (end_offset <= out.offset) {
+ // paranoid check. |end_offset| is supposed to be greater than the offset,
+ // as long as the Tell() interface is implemented correctly.
+ return OTS_FAILURE();
+ }
out.length = end_offset - out.offset;
// align tables to four bytes
« no previous file with comments | « no previous file | test/file-stream.h » ('j') | test/file-stream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698