summaryrefslogtreecommitdiffstats
path: root/src/wgtpkg-certs.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2015-12-10 16:42:35 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2015-12-10 16:42:58 +0100
commit015e28a88825e7194af39bde8c5c1c1302e3a784 (patch)
tree551519b5624d2ef7e3e286d3cf93444d3f0addd7 /src/wgtpkg-certs.c
parentf3d64b7c741677cd28e2a11deed67196cd02b46a (diff)
bug fix in calling 'd2i_X509'
Change-Id: I606ac386266cdb540203eee4568591d2c3b313ef
Diffstat (limited to 'src/wgtpkg-certs.c')
-rw-r--r--src/wgtpkg-certs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wgtpkg-certs.c b/src/wgtpkg-certs.c
index 1d8b976..b4b45fd 100644
--- a/src/wgtpkg-certs.c
+++ b/src/wgtpkg-certs.c
@@ -45,7 +45,7 @@ static int add_certificate_bin(const char *bin, int len)
const char *b, *e;
b = bin;
e = bin + len;
- while (len) {
+ while (b < e) {
X509 *x = d2i_X509(NULL, (const unsigned char **)&b, e-b);
if (x == NULL) {
syslog(LOG_ERR, "d2i_X509 failed");