Commit 5a2526244749f109f34665e25662cebb66905b35

Authored by Josh Klontz
1 parent cdf907c4

added br_iterate_utemplates diagnostic

Showing 1 changed file with 2 additions and 0 deletions
openbr/universal_template.cpp
@@ -46,6 +46,8 @@ void br_iterate_utemplates(br_const_utemplate begin, br_const_utemplate end, br_ @@ -46,6 +46,8 @@ void br_iterate_utemplates(br_const_utemplate begin, br_const_utemplate end, br_
46 while (begin != end) { 46 while (begin != end) {
47 callback(begin, context); 47 callback(begin, context);
48 begin = reinterpret_cast<br_const_utemplate>(reinterpret_cast<const char*>(begin) + sizeof(br_universal_template) + begin->size); 48 begin = reinterpret_cast<br_const_utemplate>(reinterpret_cast<const char*>(begin) + sizeof(br_universal_template) + begin->size);
  49 + if (begin > end)
  50 + qFatal("Overshot end of buffer");
49 } 51 }
50 } 52 }
51 53