Will hopefully catch a bug like this in the future.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
ssize_t nchr = OPT_LEN_MAX;
size_t envlen;
ssize_t nchr = OPT_LEN_MAX;
size_t envlen;
+ if (strlen(in) + 1 > OPT_LEN_MAX) {
+ fprintf(stderr, "OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX);
+ return NULL;
+ }
+
in[OPT_LEN_MAX] = '\0';
strncpy(in, opt, OPT_LEN_MAX);
in[OPT_LEN_MAX] = '\0';
strncpy(in, opt, OPT_LEN_MAX);
char *post, *tmp;
tmp = option_dup_subs(opt);
char *post, *tmp;
tmp = option_dup_subs(opt);
o = get_option(tmp, options, &post);
if (!o) {
o = get_option(tmp, options, &post);
if (!o) {