Codebase list openssl / a1daedd
Fix an incoherent test. 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) (cherry picked from commit cef115ff0ca4255d3decc1dda87c5418a961fd2c) FdaSilvaYY authored 6 years ago Rich Salz committed 6 years ago
1 changed file(s) with 14 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
724724 return (p);
725725 }
726726
727 /*
728 * Parse a BIO sink to create some extra oid's objects.
729 * Line format:<OID:isdigit or '.']><isspace><SN><isspace><LN>
730 */
727731 int OBJ_create_objects(BIO *in)
728732 {
729733 MS_STATIC char buf[512];
745749 *(s++) = '\0';
746750 while (isspace((unsigned char)*s))
747751 s++;
748 if (*s == '\0')
752 if (*s == '\0') {
749753 s = NULL;
750 else {
754 } else {
751755 l = s;
752756 while ((*l != '\0') && !isspace((unsigned char)*l))
753757 l++;
755759 *(l++) = '\0';
756760 while (isspace((unsigned char)*l))
757761 l++;
758 if (*l == '\0')
762 if (*l == '\0') {
759763 l = NULL;
760 } else
764 }
765 } else {
761766 l = NULL;
767 }
762768 }
763 } else
769 } else {
764770 s = NULL;
765 if ((o == NULL) || (*o == '\0'))
766 return (num);
771 }
772 if (*o == '\0')
773 return num;
767774 if (!OBJ_create(o, s, l))
768775 return (num);
769776 num++;