Skip to content

Commit 5fca7d3

Browse files
committed
Fix buildinfo buffer size
1 parent 94b93ef commit 5fca7d3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Modules/getbuildinfo.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@
3939
# endif
4040
#endif
4141

42+
// len(", release+assert+tracerefs+pystats asan msan ubsan lto=thin+pgo framework shared build")
43+
#define PY_BUILD_STR_MAXLEN 86
44+
4245
static int initialized = 0;
4346
static char buildinfo[50 + sizeof(GITVERSION) +
4447
((sizeof(GITTAG) > sizeof(GITBRANCH)) ?
45-
sizeof(GITTAG) : sizeof(GITBRANCH))];
48+
sizeof(GITTAG) : sizeof(GITBRANCH))
49+
+ PY_BUILD_STR_MAXLEN];
4650

4751
const char *
4852
Py_GetBuildInfo(void)

configure

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+3
Original file line numberDiff line numberDiff line change
@@ -7390,6 +7390,9 @@ AC_SUBST([MODULE_BLOCK])
73907390
# - "debug+tracerefs build"
73917391
# - "release+assert shared build"
73927392
# - "release lto+pgo build"
7393+
#
7394+
# If the PY_BUILD_STR format changes, PY_BUILD_STR_MAXLEN in
7395+
# Modules/getbuildinfo.c should be updated.
73937396
AC_SUBST(PY_BUILD_STR)
73947397
if test "$Py_DEBUG" = 'true' ; then
73957398
PY_BUILD_STR="debug"

0 commit comments

Comments
 (0)