|
|
@@ -3186,30 +3186,37 @@ static void message_handler_req_exec_ckpt_sectionread (
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * Determine the section size
|
|
|
+ * If data size is greater then max section size, return INVALID_PARAM
|
|
|
*/
|
|
|
- section_size = checkpoint_section->section_descriptor.section_size -
|
|
|
- req_exec_ckpt_sectionread->data_offset;
|
|
|
+ if (checkpoint->checkpoint_creation_attributes.max_section_size <
|
|
|
+ req_exec_ckpt_sectionread->data_size) {
|
|
|
|
|
|
- /*
|
|
|
- * If the library has less space available then can be sent from the
|
|
|
- * section, reduce bytes sent to library to max requested
|
|
|
- */
|
|
|
- if (section_size < req_exec_ckpt_sectionread->data_size) {
|
|
|
- section_size = 0;
|
|
|
error = SA_AIS_ERR_INVALID_PARAM;
|
|
|
goto error_exit;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * If data_offset is past end of data, return INVALID PARAM
|
|
|
+ * If data_offset is past end of data, return INVALID_PARAM
|
|
|
*/
|
|
|
if (req_exec_ckpt_sectionread->data_offset > checkpoint_section->section_descriptor.section_size) {
|
|
|
- section_size = 0;
|
|
|
error = SA_AIS_ERR_INVALID_PARAM;
|
|
|
goto error_exit;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * Determine the section size
|
|
|
+ */
|
|
|
+ section_size = checkpoint_section->section_descriptor.section_size -
|
|
|
+ req_exec_ckpt_sectionread->data_offset;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * If the library has less space available then can be sent from the
|
|
|
+ * section, reduce bytes sent to library to max requested
|
|
|
+ */
|
|
|
+ if (section_size > req_exec_ckpt_sectionread->data_size) {
|
|
|
+ section_size = req_exec_ckpt_sectionread->data_size;
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
* Write read response to CKPT library
|
|
|
*/
|