aboutsummaryrefslogtreecommitdiffstats
path: root/openssl.c
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@server.local> 2012-10-02 21:09:48 -0700
committerLibravatarLibravatar William Ahern <william@server.local> 2012-10-02 21:09:48 -0700
commitf0f38200ba99a767ebe0db5d171c98f25d4dbe54 (patch)
tree3d93e0ae171b2c29764c5ea09d000a0d47f7a325 /openssl.c
parent29ce5454955f7d7bf4c80599b9ab42e4aab0e979 (diff)
downloadluaossl-f0f38200ba99a767ebe0db5d171c98f25d4dbe54.tar.gz
luaossl-f0f38200ba99a767ebe0db5d171c98f25d4dbe54.tar.bz2
luaossl-f0f38200ba99a767ebe0db5d171c98f25d4dbe54.zip
-n
fix uninitialized read in timeutc(), and quiet GCC wrt for-loop declarations
Diffstat (limited to 'openssl.c')
-rw-r--r--openssl.c9
1 files changed, 5 insertions, 4 deletions
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))