Fixed dbConvert-memmove problems

Test program crashed on Windows-x64.
Some dbConvert.c routines used sizeof([unsigned ]long)
instead of sizeof(epics[U]Int32).
This commit is contained in:
Andrew Johnson
2014-07-08 12:32:11 -05:00
parent 659916cb16
commit 09b93f10f7
2 changed files with 5 additions and 17 deletions

View File

@@ -1313,7 +1313,7 @@ static long getLongLong(
*pbuffer = *psrc;
return(0);
}
COPYNOCONVERT(sizeof(long), paddr->pfield, pto, nRequest, no_elements, offset);
COPYNOCONVERT(sizeof(epicsInt32), paddr->pfield, pto, nRequest, no_elements, offset);
return(0);
}
@@ -1328,7 +1328,7 @@ static long getLongUlong(
*pbuffer = *psrc;
return(0);
}
COPYNOCONVERT(sizeof(long), paddr->pfield, pto, nRequest, no_elements, offset);
COPYNOCONVERT(sizeof(epicsInt32), paddr->pfield, pto, nRequest, no_elements, offset);
return(0);
}
@@ -1507,7 +1507,7 @@ static long getUlongLong(
*pbuffer = *psrc;
return(0);
}
COPYNOCONVERT(sizeof(unsigned long), paddr->pfield, pto, nRequest, no_elements, offset);
COPYNOCONVERT(sizeof(epicsUInt32), paddr->pfield, pto, nRequest, no_elements, offset);
return(0);
}
@@ -1522,7 +1522,7 @@ static long getUlongUlong(
*pbuffer = *psrc;
return(0);
}
COPYNOCONVERT(sizeof(unsigned long), paddr->pfield, pto, nRequest, no_elements, offset);
COPYNOCONVERT(sizeof(epicsUInt32), paddr->pfield, pto, nRequest, no_elements, offset);
return(0);
}

View File

@@ -102,18 +102,6 @@ static void testBasicGet(void)
memset(scratch, 0x42, sizeof(s_input));
}
{
testDiag("Crazy copy from out of bounds offset");
addr.pfield = (short*)(2*sizeof(short));
getter(&addr, scratch, s_input_len, s_input_len, (long)(s_input-2)/sizeof(short));
testOk1(memcmp(scratch, s_input, sizeof(s_input))==0);
memset(scratch, 0x42, sizeof(s_input));
}
free(scratch);
}
@@ -159,7 +147,7 @@ static void testBasicPut(void)
MAIN(testdbConvert)
{
testPlan(16);
testPlan(15);
testBasicGet();
testBasicPut();
return testDone();