fix XTVERSION parsing for unbound version strings

This commit is contained in:
nick black 2021-06-29 03:05:01 -04:00
parent 2895615e06
commit a95b28c2e5
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -742,10 +742,12 @@ extract_version(query_state* qstate, size_t slen){
static int static int
extract_xtversion(query_state* qstate, size_t slen, char suffix){ extract_xtversion(query_state* qstate, size_t slen, char suffix){
if(suffix){
if(qstate->runstring[qstate->stridx - 1] != suffix){ if(qstate->runstring[qstate->stridx - 1] != suffix){
return -1; return -1;
} }
qstate->runstring[qstate->stridx - 1] = '\0'; qstate->runstring[qstate->stridx - 1] = '\0';
}
return extract_version(qstate, slen); return extract_version(qstate, slen);
} }