Explorar el Código

This fixes some B spec related parameter checks


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@707 fd59a12c-fef9-0310-b244-a6a79926bd2f
Mark Haverkamp hace 20 años
padre
commit
19801c20ce
Se han modificado 1 ficheros con 23 adiciones y 0 borrados
  1. 23 0
      lib/evt.c

+ 23 - 0
lib/evt.c

@@ -872,6 +872,10 @@ saEvtChannelOpen(
 	SaAisErrorT error;
 	struct iovec iov;
 
+	if (!channelHandle || !channelName) {
+		return SA_AIS_ERR_INVALID_PARAM;
+	}
+
 	error = saHandleInstanceGet(&evt_instance_handle_db, evtHandle,
 			(void*)&evti);
 	
@@ -1068,6 +1072,10 @@ saEvtChannelOpenAsync(SaEvtHandleT evtHandle,
 	struct handle_list *hl;
 	struct iovec iov;
 
+	if (!channelName) {
+		return SA_AIS_ERR_INVALID_PARAM;
+	}
+
 	error = saHandleInstanceGet(&evt_instance_handle_db, evtHandle,
 			(void*)&evti);
 	
@@ -1195,6 +1203,10 @@ saEvtChannelUnlink(
 	struct iovec iov;
 	SaAisErrorT error;
 
+	if (!channelName) {
+		return SA_AIS_ERR_INVALID_PARAM;
+	}
+
 	error = saHandleInstanceGet(&evt_instance_handle_db, evtHandle,
 			(void*)&evti);
 	
@@ -1258,6 +1270,10 @@ saEvtEventAllocate(
 	struct event_channel_instance *eci;
 	struct handle_list *hl;
 
+	if (!eventHandle) {
+		return SA_AIS_ERR_INVALID_PARAM;
+	}
+
 	error = saHandleInstanceGet(&channel_handle_db, channelHandle,
 			(void*)&eci);
 	if (error != SA_AIS_OK) {
@@ -1746,6 +1762,10 @@ saEvtEventPublish(
 	void   *data_start;
 	struct iovec iov;
 
+	if (!eventId) {
+		return SA_AIS_ERR_INVALID_PARAM;
+	}
+
 	if (eventDataSize > SA_EVT_DATA_MAX_LEN) {
 		error = SA_AIS_ERR_INVALID_PARAM;
 		goto pub_done;
@@ -1886,6 +1906,9 @@ saEvtEventSubscribe(
 	int	sz;
 	struct iovec iov;
 
+	if (!filters) {
+		return SA_AIS_ERR_INVALID_PARAM;
+	}
 	error = saHandleInstanceGet(&channel_handle_db, channelHandle,
 			(void*)&eci);
 	if (error != SA_AIS_OK) {