diff options
-rw-r--r-- | source3/lib/version.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/version.c b/source3/lib/version.c index 3bd8304012..a20d650025 100644 --- a/source3/lib/version.c +++ b/source3/lib/version.c @@ -29,6 +29,7 @@ const char *samba_version_string(void) static fstring samba_version; fstring tmp_version; static BOOL init_samba_version; + size_t remaining; if (init_samba_version) return samba_version; @@ -38,8 +39,9 @@ const char *samba_version_string(void) SAMBA_VERSION_VENDOR_SUFFIX); #ifdef SAMBA_VENDOR_PATCH - fstr_sprintf( tmp_version, "-%d", SAMBA_VENDOR_PATCH ); - fstrcat( samba_version, tmp_version ); + remaining = sizeof(samba_version)-strlen(samba_version); + snprintf( tmp_version, sizeof(tmp_version), "-%d", SAMBA_VENDOR_PATCH ); + strlcat( samba_version, tmp_version, remaining-1 ); #endif init_samba_version = True; |