From f0f38200ba99a767ebe0db5d171c98f25d4dbe54 Mon Sep 17 00:00:00 2001 From: William Ahern Date: Tue, 2 Oct 2012 21:09:48 -0700 Subject: -n fix uninitialized read in timeutc(), and quiet GCC wrt for-loop declarations --- openssl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'openssl.c') diff --git a/openssl.c b/openssl.c index 34b0ca8..3ae9a9f 100644 --- a/openssl.c +++ b/openssl.c @@ -569,11 +569,11 @@ static int xn_all(lua_State *L) { ASN1_OBJECT *obj; const char *id; char txt[256]; - int nid, len; + int i, nid, len; lua_newtable(L); - for (int i = 0; i < count; i++) { + for (i = 0; i < count; i++) { if (!(entry = X509_NAME_get_entry(name, i))) continue; @@ -793,10 +793,11 @@ static int xc_digest(lua_State *L) { case 1: { static const unsigned char x[16] = "0123456789abcdef"; luaL_Buffer B; + unsigned i; luaL_buffinitsize(L, &B, 2 * len); - for (unsigned i = 0; i < len; i++) { + for (i = 0; i < len; i++) { luaL_addchar(&B, x[0x0f & (md[i] >> 4)]); luaL_addchar(&B, x[0x0f & (md[i] >> 0)]); } @@ -870,7 +871,7 @@ static _Bool scan(int *i, char **cp, int n, int signok) { static double timeutc(ASN1_TIME *time) { char buf[32] = "", *cp; struct tm tm; - int gmtoff, year, i; + int gmtoff = 0, year, i; double ts; if (!ASN1_TIME_check(time)) -- cgit v1.2.3-55-g6feb