GetConversionSize sanity check

Andreas Pflug pflug at pse-consulting.de
Thu Nov 18 05:36:52 CST 2010


---
 dlls/oledb32/convert.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c
index 4b07154..7221af0 100644
--- a/dlls/oledb32/convert.c
+++ b/dlls/oledb32/convert.c
@@ -1057,6 +1057,9 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
 {
     convert *This = impl_from_IDataConvert(iface);
 
+    if (!pcbDstLength)
+	return E_INVALIDARG;
+
     DBLENGTH len = 0;
     switch(wDstType)
     {
@@ -1088,6 +1091,8 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
         *pcbDstLength = sizeof(FILETIME); return S_OK;
     case DBTYPE_GUID:
         *pcbDstLength = sizeof(GUID); return S_OK;
+    /*  partial implementation: calculation for wSrcType!=wDstType omitted.
+	pcbSrcLength == NULL might be illegal for variable-length types (shouldn't pSrc be examined in that case?) */
     case DBTYPE_STR:
 	if (wSrcType == wDstType && pcbSrcLength)
 	{
-- 
1.7.2.3


--------------030505070201000701020308
Content-Type: text/plain;
 name="0004-DBTIMESTAMP-accuracy-hint.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0004-DBTIMESTAMP-accuracy-hint.txt"



More information about the wine-patches mailing list