Pointer 'o' is set inside a local buffer, so it can't be NULL.
Also fix coding style and add comments
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4754)
return p;
}
+/*
+ * Parse a BIO sink to create some extra oid's objects.
+ * Line format:<OID:isdigit or '.']><isspace><SN><isspace><LN>
+ */
int OBJ_create_objects(BIO *in)
{
char buf[512];
*(s++) = '\0';
while (ossl_isspace(*s))
s++;
- if (*s == '\0')
+ if (*s == '\0') {
s = NULL;
- else {
+ } else {
l = s;
while (*l != '\0' && !ossl_isspace(*l))
l++;
*(l++) = '\0';
while (ossl_isspace(*l))
l++;
- if (*l == '\0')
+ if (*l == '\0') {
l = NULL;
- } else
+ }
+ } else {
l = NULL;
+ }
}
- } else
+ } else {
s = NULL;
- if ((o == NULL) || (*o == '\0'))
+ }
+ if (*o == '\0')
return num;
if (!OBJ_create(o, s, l))
return num;