qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] monitor: assert monitor_puts()'s loop invariant
@ 2013-01-10 13:10 Markus Armbruster
  2013-01-10 17:20 ` Luiz Capitulino
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Armbruster @ 2013-01-10 13:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: lcapitulino

Chiefly to hush up Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/monitor.c b/monitor.c
index 9cf419b..c6eac60 100644
--- a/monitor.c
+++ b/monitor.c
@@ -270,6 +270,7 @@ static void monitor_puts(Monitor *mon, const char *str)
     char c;
 
     for(;;) {
+        assert(mon->outbuf_index < sizeof(mon->outbuf) - 1);
         c = *str++;
         if (c == '\0')
             break;
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] monitor: assert monitor_puts()'s loop invariant
  2013-01-10 13:10 [Qemu-devel] [PATCH] monitor: assert monitor_puts()'s loop invariant Markus Armbruster
@ 2013-01-10 17:20 ` Luiz Capitulino
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Capitulino @ 2013-01-10 17:20 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On Thu, 10 Jan 2013 14:10:22 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> Chiefly to hush up Coverity.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Applied to the qmp branch, thanks.

> ---
>  monitor.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/monitor.c b/monitor.c
> index 9cf419b..c6eac60 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -270,6 +270,7 @@ static void monitor_puts(Monitor *mon, const char *str)
>      char c;
>  
>      for(;;) {
> +        assert(mon->outbuf_index < sizeof(mon->outbuf) - 1);
>          c = *str++;
>          if (c == '\0')
>              break;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-10 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-10 13:10 [Qemu-devel] [PATCH] monitor: assert monitor_puts()'s loop invariant Markus Armbruster
2013-01-10 17:20 ` Luiz Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).