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.
This commit is contained in:
Antoine Pitrou 2011-03-09 12:54:00 +01:00
parent 9d4836e731
commit 2ddaaff62d
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,9 @@ What's New in Python 2.7.2?
Core and Builtins 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. - Issue #10451: memoryview objects could allow to mutate a readable buffer.
Initial patch by Ross Lagerwall. Initial patch by Ross Lagerwall.

View file

@ -42,7 +42,9 @@
const char * const char *
Py_GetBuildInfo(void) 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 *revision = _Py_hgversion();
const char *sep = *revision ? ":" : ""; const char *sep = *revision ? ":" : "";
const char *hgid = _Py_hgidentifier(); const char *hgid = _Py_hgidentifier();