Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: UListIO: byteSize overflowing on really big faceLists

  • Loading branch information...
commit 97cf67d6993275c1335885b462745bf212fcd025 1 parent f978623
mattijs authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/OpenFOAM/containers/Lists/UList/UListIO.C
View
4 src/OpenFOAM/containers/Lists/UList/UListIO.C
@@ -126,7 +126,9 @@ Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
os << nl << L.size() << nl;
if (L.size())
{
- os.write(reinterpret_cast<const char*>(L.v_), L.byteSize());
+ // Note: do not use byteSize to avoid overflow on really big
+ // arrays.
+ os.write(reinterpret_cast<const char*>(L.v_), L.size()*sizeof(T));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.