Skip to content

Commit

Permalink
Merge pull request #147 from v0-e/jer-os-allow-empty
Browse files Browse the repository at this point in the history
jer: OCTET STRING allow empty
  • Loading branch information
mouse07410 authored Dec 3, 2023
2 parents bc7f333 + d7d3ed8 commit 22823e9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions skeletons/OCTET_STRING_jer.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,18 @@ static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_b
int half = 0; /* Half bit */
uint8_t *buf;

/* Strip quotes */
for (; p < pend; ++p) {
if (*p == CQUOTE)
if (*p == CQUOTE) {
++p;
break;
}
}
++p;

for (; pend > p; --pend) {
for (; pend >= p; --pend) {
if (*pend == CQUOTE)
break;
}

if (pend - p < 2) return -1;

if (pend - p < 0) return -1;
chunk_size = pend - p;

/* Reallocate buffer according to high cap estimation */
Expand Down

0 comments on commit 22823e9

Please sign in to comment.