Sfoglia il codice sorgente

Return INVALID_PARAM when section read is larger then checkpoint section

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1125 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 19 anni fa
parent
commit
b67675edc5
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      exec/ckpt.c

+ 4 - 2
exec/ckpt.c

@@ -3195,8 +3195,10 @@ static void message_handler_req_exec_ckpt_sectionread (
 	 * 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;
+	if (section_size < req_exec_ckpt_sectionread->data_size) {
+		section_size = 0;
+		error = SA_AIS_ERR_INVALID_PARAM;
+		goto error_exit;
 	}
 
 	/*