From 7983d33f543685564ba6b900e162a9aaadb2ea82 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 9 Mar 2011 12:34:41 +0100 Subject: Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when there are many tags (e.g. when using mq). Patch by Nadeem Vawda. --- Misc/NEWS | 3 +++ Modules/getbuildinfo.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index c4a271b..b3d099b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.1.4? Core and Builtins ----------------- +- Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when + there are many tags (e.g. when using mq). Patch by Nadeem Vawda. + - Issue #10451: memoryview objects could allow to mutate a readable buffer. Initial patch by Ross Lagerwall. diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index c70126d..ac51881 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -42,7 +42,9 @@ const char * Py_GetBuildInfo(void) { - static char buildinfo[50]; + static char buildinfo[50 + sizeof HGVERSION + + ((sizeof HGTAG > sizeof HGBRANCH) ? + sizeof HGTAG : sizeof HGBRANCH)]; const char *revision = _Py_hgversion(); const char *sep = *revision ? ":" : ""; const char *hgid = _Py_hgidentifier(); -- cgit v0.12