size_t size;
FILE *tmp;
if(Param_getBlob(param, name, idx, &size, &tmp) == 0) {
- index = (unsigned int) (size + 1) / sizeof(aitUint32);
+ index = (unsigned int) ((size - 1) / sizeof(aitUint32)) + 2;
} else {
index = 0;
}
int retVal;
retVal = Param_getBlob(param, name, idx, &size, &blob);
- index = 1 + (((unsigned int) size - 1) / sizeof(aitUint32));
+ index = 2 + (((unsigned int) size - 1) / sizeof(aitUint32));
if((retVal != 0) || (index == 0)) {
return S_cas_noRead;
} else {
aitUint32 *ourValue = new aitUint32[index];
- fread(ourValue, sizeof(aitUint32), index, blob);
+ *ourValue = size;
+ fread(ourValue + 1, sizeof(aitUint32), index - 1, blob);
fclose(blob);
value.putRef(ourValue);
caServer *pCAS = this->getCAS();
retVal = Param_getBlob(param, name, idx, &size, &blob);
- index = 1 + (((unsigned int) size - 1) / sizeof(aitUint32));
+ index = 2 + (((unsigned int) size - 1) / sizeof(aitUint32));
if((retVal != 0) || (index == 0)) {
return S_cas_noRead;
} else {
aitUint32 *ourValue = new aitUint32[index];
- fread(ourValue, sizeof(aitUint32), index, blob);
+ *ourValue = size;
+ fread(ourValue + 1, sizeof(aitUint32), index - 1, blob);
fclose(blob);
val = new gddAtomic(gddAppType_value, aitEnumString, 1, index);