]> granicus.if.org Git - python/commitdiff
Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 9 Mar 2011 11:54:00 +0000 (12:54 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 9 Mar 2011 11:54:00 +0000 (12:54 +0100)
there are many tags (e.g. when using mq).  Patch by Nadeem Vawda.

Misc/NEWS
Modules/getbuildinfo.c

index 10f7d6b2ee1f54f1be8f45c4c6aaca24c2fac5e8..c3117cbcad0e1f8a30332016bcaf5e25a72552f3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -9,6 +9,9 @@ What's New in Python 2.7.2?
 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.
 
index c70126d58419b321d8c8d1b6a827e2c3ebb7b5de..ac5188126cdc253fe08f4c516d10d525271d133e 100644 (file)
@@ -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();