diff options
author | William Ahern <william@server.local> | 2012-10-02 21:09:48 -0700 |
---|---|---|
committer | William Ahern <william@server.local> | 2012-10-02 21:09:48 -0700 |
commit | f0f38200ba99a767ebe0db5d171c98f25d4dbe54 (patch) | |
tree | 3d93e0ae171b2c29764c5ea09d000a0d47f7a325 | |
parent | 29ce5454955f7d7bf4c80599b9ab42e4aab0e979 (diff) | |
download | luaossl-f0f38200ba99a767ebe0db5d171c98f25d4dbe54.tar.gz luaossl-f0f38200ba99a767ebe0db5d171c98f25d4dbe54.tar.bz2 luaossl-f0f38200ba99a767ebe0db5d171c98f25d4dbe54.zip |
-n
fix uninitialized read in timeutc(), and quiet GCC wrt for-loop declarations
-rw-r--r-- | openssl.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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)) |