[Top] [All Lists]

Re: [PATCH 9/9] xfsdump: fix uninit ackstr in content_mediachange_query(

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH 9/9] xfsdump: fix uninit ackstr in content_mediachange_query()
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Thu, 13 Nov 2014 12:10:01 -0600
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1415818638-32700-10-git-send-email-sandeen@xxxxxxxxxx>
References: <1415818638-32700-1-git-send-email-sandeen@xxxxxxxxxx> <1415818638-32700-10-git-send-email-sandeen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 11/12/14 12:57, Eric Sandeen wrote:
Today, this sends an uninitialized ackstr[0] to be mlog'd -
who knows what we get out of it.  Other places follow this
"count = 0, string = "\n"" pattern which seemsa bit odd, but
better than printing uninitialized memory.

To be completely honest, I have no test for this.

Signed-off-by: Eric Sandeen<sandeen@xxxxxxxxxx>
  restore/content.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/restore/content.c b/restore/content.c
index c99aed7..bc5b398 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -2915,6 +2915,7 @@ content_mediachange_query( void )
                        bagp = 0;
                ackcnt = 0;
+               ackstr[ ackcnt++ ] = "\n";
                dlog_multi_ack( ackstr,
                                ackcnt );
                querycnt = 0;

dlog_multi_ack() with count of 0 will exit without doing anything.

Looks like some conditional code that filled the ackstr array (like the other callers) was removed. I vote to pull ackstr, ackcnt and the dlog_multi_ack() from this function.


<Prev in Thread] Current Thread [Next in Thread>