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 <jbeul...@suse.com>
Thank you!
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel