As this function can now be invoked with only the second glob "active",
it must avoid accessing the first one if not in use.
Follow-up to
2238f0921cb00b3395847
Spotted by Codex Security
Closes #21586
while(*filename) {
CURLcode result = CURLE_OK;
struct URLPattern *pat = NULL;
- if(*filename == '#' && ISDIGIT(filename[1])) {
+ if(glob_inuse(glob) && *filename == '#' && ISDIGIT(filename[1])) {
/* a numbered glob reference */
const char *ptr = filename++;
curl_off_t num;