We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79c15a0 commit c2c80d8Copy full SHA for c2c80d8
src/cctz/src/time_zone_fixed.cc
@@ -125,8 +125,11 @@ std::string FixedOffsetToName(const seconds& offset) {
125
ep = Format02d(ep, offset_seconds, false);
126
}
127
*ep++ = '\0';
128
- // package:odbc: Less strict assert
129
- assert(ep - buf <= (long int)sizeof(buf));
+ // package:odbc: Less strict
+ // package:odbc: throw rather than assert
130
+ if (ep - buf > (long int)sizeof(buf)) {
131
+ throw std::runtime_error("Unexpected buffer overflow");
132
+ }
133
return buf;
134
135
0 commit comments