x509asn1: fix to return error in an error case from encodeOID()

Found by Codex Security

Follow-up to d8b0318ad6 #3582

Closes #20991
This commit is contained in:
Viktor Szakats 2026-03-19 00:11:33 +01:00
parent 59405ffb7d
commit 86c25c06c9
No known key found for this signature in database

View File

@ -442,7 +442,7 @@ static CURLcode encodeOID(struct dynbuf *store,
x = 0;
do {
if(x & 0xFF000000)
return CURLE_OK;
return CURLE_BAD_FUNCTION_ARGUMENT;
else if(beg == end)
return CURLE_BAD_FUNCTION_ARGUMENT;
y = *(const unsigned char *)beg++;