Message ID | 20171127071817.25999-1-ebiggers3@gmail.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Herbert Xu |
Headers | show |
I wonder if all -EBADMSG returns here should just print "(badoid)" into the buffer. David
diff --git a/lib/oid_registry.c b/lib/oid_registry.c index 5a75d127995d..3640170f0d65 100644 --- a/lib/oid_registry.c +++ b/lib/oid_registry.c @@ -115,8 +115,10 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize) size_t ret; int count; - if (v >= end) + if (v >= end) { + snprintf(buffer, bufsize, "(empty)"); return -EBADMSG; + } n = *v++; ret = count = snprintf(buffer, bufsize, "%u.%u", n / 40, n % 40);