Просмотр исходного кода

Do not perform arithmetic on "void*" pointers.

* exec/vsf_ykd.c (ykd_deliver_fn): Do not perform "void*" arithmetic.
* services/votequorum.c (quorum_deliver_fn): Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1907 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 лет назад
Родитель
Сommit
6a327f134b
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      exec/vsf_ykd.c
  2. 1 1
      services/votequorum.c

+ 2 - 2
exec/vsf_ykd.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -346,7 +346,7 @@ static void ykd_deliver_fn (
 	int all_received = 1;
 	int state_position = 0;
 	int i;
-	char *msg_state = iovec->iov_base + sizeof (struct ykd_header);
+	char *msg_state = (char *)(iovec->iov_base) + sizeof (struct ykd_header);
 	
 	/*
 	 * If this is a localhost address, this node is always primary

+ 1 - 1
services/votequorum.c

@@ -994,7 +994,7 @@ static void quorum_deliver_fn(unsigned int nodeid, struct iovec *iovec, int iov_
 	if (header->tgtport == 0 &&
 	    (header->tgtid == us->node_id ||
 	     header->tgtid == 0)) {
-		buf = iovec->iov_base + sizeof(struct q_protheader);
+		buf = (char *)(iovec->iov_base) + sizeof(struct q_protheader);
 		switch (*buf) {
 
 		case VOTEQUORUM_MSG_NODEINFO: