SF 1690420 make memcpy calculate buffer length with sizeof()

This commit is contained in:
clay_shooter
2007-03-31 21:48:24 +00:00
parent fcbae0a84f
commit 7428d6590a
2 changed files with 18 additions and 13 deletions

View File

@@ -5,7 +5,7 @@
<h3>What's New</h3> <h3>What's New</h3>
<ul> <ul>
<li> <li>
<b>No New Features</b> <b>Now compiles with with Visual versions later than VC 98</b>
</li> </li>
</ul> </ul>
@@ -16,19 +16,19 @@
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1651926 </td> <td width="13%" valign="top">1651926 </td>
<td width="87%" valign="top">(prelease 1) ActiveXComponent: getPropertyAsString should call getString() instead of toString()</td> <td width="87%" valign="top">(pre-release 1) ActiveXComponent: getPropertyAsString should call getString() instead of toString()</td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1569864 </td> <td width="13%" valign="top">1569864 </td>
<td width="87%" valign="top">(prelease 1) IEnumVariant leak fixed in patch 1674179</td> <td width="87%" valign="top">(pre-release 1) IEnumVariant leak fixed in patch 1674179</td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1112667</td> <td width="13%" valign="top">1112667</td>
<td width="87%" valign="top">(prelease 1) IEnumVariant leak fixed in patch 1674179</td> <td width="87%" valign="top">(pre-release 1) IEnumVariant leak fixed in patch 1674179</td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1465539</td> <td width="13%" valign="top">1465539</td>
<td width="87%" valign="top">(prelease 1) IEnumVariant leak fixed in patch 1674179</td> <td width="87%" valign="top">(pre-release 1) IEnumVariant leak fixed in patch 1674179</td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">&nbsp;</td> <td width="13%" valign="top">&nbsp;</td>
@@ -39,22 +39,27 @@
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1674015</td> <td width="13%" valign="top">1674015</td>
<td width="87%" valign="top">(prelease 1) ROT hashmap handling when autogc=no (default) can lead to key collisions <td width="87%" valign="top">(pre-release 1) ROT hashmap handling when autogc=no (default) can lead to key collisions
in hashmap. This causes objects to be garbage finalized when they shouldn't be resulting in vm failures in hashmap. This causes objects to be garbage finalized when they shouldn't be resulting in vm failures
with large (large) numbers of objects. </td> with large (large) numbers of objects. </td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1674179</td> <td width="13%" valign="top">1674179</td>
<td width="87%" valign="top">(prelease 1) Fixed Enum leaks with EnumVariants in Variant.cpp and EnumVariant.cpp</td> <td width="87%" valign="top">(pre-release 1) Fixed Enum leaks with EnumVariants in Variant.cpp and EnumVariant.cpp</td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1687419</td> <td width="13%" valign="top">1687419</td>
<td width="87%" valign="top">(prelease 3) Corrected calls to AttachCurrentThread in EventProxy</td> <td width="87%" valign="top">(pre-release 3) Corrected calls to AttachCurrentThread in EventProxy</td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1689061 </td> <td width="13%" valign="top">1689061 </td>
<td width="87%" valign="top">(prelease 4) C code changes to fix VC2003 compiler warnings.</td> <td width="87%" valign="top">(pre-release 4) C code changes to fix VC2003 compiler warnings.</td>
</tr> </tr>
<tr>
<td width="13%" valign="top">1690420</td>
<td width="87%" valign="top">(pre-release 4)Incorrect memcpy lengths for Currency Variants</td>
</tr>
<tr> <tr>
<td width="13%" valign="top">&nbsp;</td> <td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">&nbsp;</td> <td width="87%" valign="top">&nbsp;</td>
@@ -64,7 +69,7 @@
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">1662887</td> <td width="13%" valign="top">1662887</td>
<td width="87%" valign="top">(prelease 1) Dispatch static methods should throw runtime exceptions when <td width="87%" valign="top">(pre-release 1) Dispatch static methods should throw runtime exceptions when
null is passed in for the Dispatch object and when the Dispatch object is in an invalid state. </td> null is passed in for the Dispatch object and when the Dispatch object is in an invalid state. </td>
</tr> </tr>
<tr> <tr>

View File

@@ -656,7 +656,7 @@ JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantCurrency
CY cy; CY cy;
cy = V_CY(v); cy = V_CY(v);
jlong jl; jlong jl;
memcpy(&jl, &cy, 8); // was 64. should be sizeof(x) SF 1689061 memcpy(&jl, &cy, sizeof(jl)); // was 64. should be sizeof(x) SF 1690420
return jl; return jl;
} }
return NULL; return NULL;
@@ -683,7 +683,7 @@ JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantCurrencyRef
if (v) { if (v) {
VariantClear(v); // whatever was there before VariantClear(v); // whatever was there before
CY *pf = (CY *)CoTaskMemAlloc(sizeof(CY)); CY *pf = (CY *)CoTaskMemAlloc(sizeof(CY));
memcpy(pf, &cur, 8); // was 64. should be sizeof(x) SF 1689061 memcpy(pf, &cur, sizeof(*pf)); // was 64. should be sizeof(x) SF 1690420
V_VT(v) = VT_BYREF|VT_CY; V_VT(v) = VT_BYREF|VT_CY;
V_CYREF(v) = pf; V_CYREF(v) = pf;
} }
@@ -795,7 +795,7 @@ JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantCurrencyRef
CY *cy; CY *cy;
cy = V_CYREF(v); cy = V_CYREF(v);
jlong jl; jlong jl;
memcpy(&jl, cy, 8); // was 64. should be sizeof(x) SF 1689061 memcpy(&jl, cy, sizeof(jl)); // was 64. should be sizeof(x) SF 1690420
return jl; return jl;
} }
return NULL; return NULL;