diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-04-07 20:41:03 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-04-07 20:43:00 +0200 |
commit | 2432d09c7a7115004b16eb11bf81ffeeb32d15ad (patch) | |
tree | 36c18851d141aea69954c9a87d8a65eb7e9919a0 /src/basic/hexdecoct.h | |
parent | network: re-indent conf parsers in wireguard.c (diff) | |
download | systemd-2432d09c7a7115004b16eb11bf81ffeeb32d15ad.tar.xz systemd-2432d09c7a7115004b16eb11bf81ffeeb32d15ad.zip |
util: extend unbase64mem() to accept secure flag
When the flag is set, buffer is cleared on failure.
Diffstat (limited to 'src/basic/hexdecoct.h')
-rw-r--r-- | src/basic/hexdecoct.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/basic/hexdecoct.h b/src/basic/hexdecoct.h index 9477d16e37..fa6013ee75 100644 --- a/src/basic/hexdecoct.h +++ b/src/basic/hexdecoct.h @@ -33,6 +33,9 @@ ssize_t base64mem(const void *p, size_t l, char **out); int base64_append(char **prefix, int plen, const void *p, size_t l, int margin, int width); -int unbase64mem(const char *p, size_t l, void **mem, size_t *len); +int unbase64mem_full(const char *p, size_t l, bool secure, void **mem, size_t *len); +static inline int unbase64mem(const char *p, size_t l, void **mem, size_t *len) { + return unbase64mem_full(p, l, false, mem, len); +} void hexdump(FILE *f, const void *p, size_t s); |