From: Anthony Geay Date: Fri, 13 May 2016 06:41:14 +0000 (+0200) Subject: Protection against write on deallocated underground array of fields. X-Git-Tag: V8_1_0a1~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a38081f11fc4d5f5d78fdbb354764b6e1a80dd5d;p=tools%2Fmedcoupling.git Protection against write on deallocated underground array of fields. --- diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 698e6ecd7..85ffea449 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -778,6 +778,8 @@ void MEDFileFieldPerMeshPerTypePerDisc::writeLL(med_idt fid, const MEDFileFieldN const DataArray *arr=getOrCreateAndGetArray(); if(!arr) throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::writeLL : no array set !"); + if(!arr->isAllocated()) + throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::writeLL : the array to be written is not allocated !"); const DataArrayDouble *arrD=dynamic_cast(arr); const DataArrayInt *arrI=dynamic_cast(arr); const unsigned char *locToWrite=0;