The dats_get_ia_handle call was change in 2.0.34 to convert IA handle from
both vector to handle and handle to vector to fix query calls that
incorrectly returned IA handles in non-vector form. If a caller uses a
non vector IA handle it will get converted incorrectly to a vector and cause
a segfault. Add additional check to verify a IA handle type before calling
get ia handle to avoid incorrect translation.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
IN DAT_EXTENDED_OP ext_op, IN ...)
{
DAT_RETURN status;
- DAT_IA_HANDLE dapl_handle;
+ DAT_IA_HANDLE dapl_handle = handle;
va_list args;
if (handle == NULL) {
DAT_INVALID_HANDLE1);
}
- /* If not IA handle then just passthrough */
- if (dats_get_ia_handle(handle, &dapl_handle) != DAT_SUCCESS) {
- dapl_handle = handle;
- }
+ /* only convert if ia_handle vector */
+ if (dats_is_ia_handle(handle)) {
+ if (dats_get_ia_handle(handle, &dapl_handle))
+ return DAT_ERROR(DAT_INVALID_HANDLE,
+ DAT_INVALID_HANDLE1);
+ }
/* verify provider extension support */
if (!g_dat_extensions) {