{"thread":{"id":"29418","subject":"[PATCH] fix git-gui crash due to uninitialized variable","startedAt":"2012-01-21T17:57:28Z","lastAt":"2012-01-22T23:18:58Z","messageCount":3,"participants":["Clemens Buchacher","Junio C Hamano","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"182900","messageId":"20120121175724.GA7319@ecki","threadId":"29418","inReplyTo":null,"subject":"[PATCH] fix git-gui crash due to uninitialized variable","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2012-01-21T17:57:28Z","receivedAt":"2012-01-21T17:57:28Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Recently, a clone initiated via git gui on Windows crashed on me due to\nan \"unknown variable cdone\". It turns out that there is a code path\nwhere this variable is used uninitialized.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n\nLooking at the output of display(), it's not clear to me now the\nfunction below could ever be called with total=0. But I can't delve into\nit more deeply right now, and this seems like an obvious fix.\n\n git-gui/lib/status_bar.tcl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui/lib/status_bar.tcl b/git-gui/lib/status_bar.tcl\nindex 95cb449..02111a1 100644\n--- a/git-gui/lib/status_bar.tcl\n+++ b/git-gui/lib/status_bar.tcl\n@@ -77,6 +77,7 @@ method start {msg uds} {\n \n method update {have total} {\n \tset pdone 0\n+\tset cdone 0\n \tif {$total > 0} {\n \t\tset pdone [expr {100 * $have / $total}]\n \t\tset cdone [expr {[winfo width $w_c] * $have / $total}]\n-- \n1.7.8\n"},{"id":"182910","messageId":"7v1uqsbt66.fsf@alter.siamese.dyndns.org","threadId":"29418","inReplyTo":"20120121175724.GA7319@ecki","subject":"Re: [PATCH] fix git-gui crash due to uninitialized variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-01-21T22:13:37Z","receivedAt":"2012-01-21T22:13:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Clemens Buchacher <drizzd@aon.at> writes:\n\n> Recently, a clone initiated via git gui on Windows crashed on me due to\n> an \"unknown variable cdone\". It turns out that there is a code path\n> where this variable is used uninitialized.\n>\n> Signed-off-by: Clemens Buchacher <drizzd@aon.at>\n> ---\n\nThanks, but Clemens, please don't Cc: me git-gui patches, which I won't\ntake directly.\n\nPinging Pat.\n\n> Looking at the output of display(), it's not clear to me now the\n> function below could ever be called with total=0. But I can't delve into\n> it more deeply right now, and this seems like an obvious fix.\n>\n>  git-gui/lib/status_bar.tcl |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-gui/lib/status_bar.tcl b/git-gui/lib/status_bar.tcl\n> index 95cb449..02111a1 100644\n> --- a/git-gui/lib/status_bar.tcl\n> +++ b/git-gui/lib/status_bar.tcl\n> @@ -77,6 +77,7 @@ method start {msg uds} {\n>  \n>  method update {have total} {\n>  \tset pdone 0\n> +\tset cdone 0\n>  \tif {$total > 0} {\n>  \t\tset pdone [expr {100 * $have / $total}]\n>  \t\tset cdone [expr {[winfo width $w_c] * $have / $total}]\n"},{"id":"182946","messageId":"87bopvz5p9.fsf@fox.patthoyts.tk","threadId":"29418","inReplyTo":"20120121175724.GA7319@ecki","subject":"Re: [PATCH] fix git-gui crash due to uninitialized variable","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2012-01-22T23:18:58Z","receivedAt":"2012-01-22T23:18:58Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Clemens Buchacher <drizzd@aon.at> writes:\n\n>Recently, a clone initiated via git gui on Windows crashed on me due to\n>an \"unknown variable cdone\". It turns out that there is a code path\n>where this variable is used uninitialized.\n>\n>Signed-off-by: Clemens Buchacher <drizzd@aon.at>\n>---\n>\n>Looking at the output of display(), it's not clear to me now the\n>function below could ever be called with total=0. But I can't delve into\n>it more deeply right now, and this seems like an obvious fix.\n>\n> git-gui/lib/status_bar.tcl |    1 +\n> 1 files changed, 1 insertions(+), 0 deletions(-)\n>\n>diff --git a/git-gui/lib/status_bar.tcl b/git-gui/lib/status_bar.tcl\n>index 95cb449..02111a1 100644\n>--- a/git-gui/lib/status_bar.tcl\n>+++ b/git-gui/lib/status_bar.tcl\n>@@ -77,6 +77,7 @@ method start {msg uds} {\n> \n> method update {have total} {\n> \tset pdone 0\n>+\tset cdone 0\n> \tif {$total > 0} {\n> \t\tset pdone [expr {100 * $have / $total}]\n> \t\tset cdone [expr {[winfo width $w_c] * $have / $total}]\n\nIt might be nice to know what kind of conditions triggered this for you,\nbut the patch is fine. Thanks, applied.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}