[Python-checkins] (3.1): Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when

antoine.pitrou python-checkins at python.org
Wed Mar 9 12:54:11 CET 2011


http://hg.python.org/cpython/rev/0f9e5042907c
changeset:   68342:0f9e5042907c
branch:      3.1
parent:      68339:6b6b8af33811
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Mar 09 12:34:41 2011 +0100
summary:
  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.

files:
  Misc/NEWS
  Modules/getbuildinfo.c

diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
 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
--- 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();

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list