common: Use larger buffer for homedir in case of 64 bit UIDs.

* common/homedir.c (_gnupg_socketdir_internal): Enlarge PREFIX by 6
bytes for "/gnupg".
--

The temporary buffer was to short for the extra "/gnupg".  However the
20 bytes for the UID is large enough for all 32 bit UIDs and would
only fail (detected) if  a 64 bit UID is used.

Fixes-commit: 17efcd2a2a
Reported-by: Rainer Perske.
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-12-20 15:37:29 +01:00
parent 84555d5372
commit 290348e349
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 1 additions and 1 deletions

View File

@ -554,7 +554,7 @@ _gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
};
int i;
struct stat sb;
char prefix[13 + 1 + 20 + 6 + 1];
char prefix[19 + 1 + 20 + 6 + 1];
const char *s;
char *name = NULL;