vector subscript out of range assertion hit on windows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Undecided
|
Paul J. Lucas |
Bug Description
in src/zorbatypes/
aBase64.
copy_
);
if in this case aLength is of size 0 the assertion "vector subscript out of range" is hit on windows in debug build. This happens because size == pos in std::vector implementation on windows:
reference operator[
{ // subscript mutable sequence
#if _ITERATOR_
if (size() <= _Pos)
{ // report error
_DEBUG_
_SCL_
}
Therefore, before accessing a vector with [0] one must check whether the size of the vector is > 0. Otherwise the mentioned assertion will trigger.
Related branches
- Dennis Knochenwefel: Approve
- Paul J. Lucas: Approve
-
Diff: 122 lines (+45/-34)1 file modifiedsrc/zorbatypes/binary.cpp (+45/-34)
Changed in zorba: | |
status: | New → In Progress |
Changed in zorba: | |
status: | In Progress → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |