--- multipath-tools-0.4.4/multipathd/log.c.orig 2005-05-04 16:46:14.146824760 -0400 +++ multipath-tools-0.4.4/multipathd/log.c 2005-05-04 17:08:39.212237970 -0400 @@ -89,6 +89,7 @@ void log_close (void) return; } +#define ALIGN(len, s) (((len)+(s)-1)/(s)*(s)) int log_enqueue (int prio, const char * fmt, va_list ap) { int len, fwd; @@ -101,10 +102,10 @@ int log_enqueue (int prio, const char * if (!la->empty) { fwd = sizeof(struct logmsg) + strlen((char *)&lastmsg->str) * sizeof(char) + 1; - la->tail += fwd; + la->tail += ALIGN(fwd, sizeof(void *)); } vsnprintf(buff, MAX_MSG_SIZE, fmt, ap); - len = strlen(buff) * sizeof(char) + 1; + len = ALIGN(strlen(buff) * sizeof(char) + 1, sizeof(void *)); /* not enough space on tail : rewind */ if (la->head <= la->tail && @@ -128,7 +129,7 @@ int log_enqueue (int prio, const char * la->empty = 0; msg = (struct logmsg *)la->tail; msg->prio = prio; - memcpy((void *)&msg->str, buff, len); + memcpy((void *)&msg->str, buff, strlen(buff)); lastmsg->next = la->tail; msg->next = la->head;