cmdline_read_user: Fix NULL terminating code

Add indirection to pointer when NULL terminating the 'user' variable in
cmdline_read_user().
This commit is contained in:
Jon Shallow committed 2020-11-13 17:00:19 +00:00
1 parent ae9429fc20
commit 05f6f8d401
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1306,7 +1306,7 @@ cmdline_read_user(char *arg, unsigned char **buf, size_t maxlen) {
if (len) {
*buf = (unsigned char *)arg;
/* len is the size or less, so 0 terminate to maxlen */
buf[len] = '\000';
(*buf)[len] = '\000';
}
/* 0 length Identity is valid */
return len;
+1 -1
View File
@@ -2222,7 +2222,7 @@ cmdline_read_user(char *arg, unsigned char **buf, size_t maxlen) {
if (len) {
*buf = (unsigned char *)arg;
/* len is the size or less, so 0 terminate to maxlen */
buf[len] = '\000';
(*buf)[len] = '\000';
}
/* 0 length Identity is valid */
return len;