From 4ee805e2eca25e4fc2d1c35c5dbfb736fd420a33 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Tue, 12 Dec 2023 15:18:01 +0000 Subject: [PATCH] Fix bad parsing in option -D (it was potentially checking -F contents). (#8187) Fixes #8186 --- src/psimage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/psimage.c b/src/psimage.c index 84178077ebc..11b7d97a017 100644 --- a/src/psimage.c +++ b/src/psimage.c @@ -165,6 +165,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSIMAGE_CTRL *Ctrl, struct GMT_OP break; case 'D': n_errors += gmt_M_repeated_module_option (API, Ctrl->D.active); + strncpy(string, opt->arg, GMT_LEN256 - 1); p = (string[0]) ? string : opt->arg; /* If -C was used the string is set */ if ((Ctrl->D.refpoint = gmt_get_refpoint (GMT, p, 'D')) == NULL) { /* Failed basic parsing */ GMT_Report (API, GMT_MSG_ERROR, "Option -D: Basic parsing of reference point in %s failed\n", opt->arg);