Re: [PATCH v1 1/2] IB/core, cma: Nice log-friendly string helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/11/15 12:00, Sagi Grimberg wrote:
+__attribute_const__ const char *cma_event_msg(enum rdma_cm_event_type event)
+{
+	return event < ARRAY_SIZE(cma_events) ?
+			cma_events[event] : "UNRECOGNIZED_EVENT";
+}

Please cast "event" to an unsigned type before comparing it with the array size such that passing a negative value to this function or any similar function doesn't cause havoc.

Thanks,

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux