[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 2/4] xen/console: Rework HYPERCALL_console_io interface
On 08/08/2019 14:57, Jan Beulich wrote: On 05.08.2019 15:29, Julien Grall wrote:@@ -627,6 +629,15 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer) rc = guest_console_write(buffer, count); break; case CONSOLEIO_read: + /* + * The return value is either the number of characters read or + * a negative value in case of error. So we need to prevent + * overlap between the two sets. + */ + rc = -E2BIG; + if ( (int)count < 0 ) + break;A more portable (afaict) approach would be to check against INT_MAX. It would be better than the cast. I will update it. Either way Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Thank you! Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |