Commit 3589e6f5 authored by Grigorii Demidov's avatar Grigorii Demidov Committed by Petr Špaček

modules/dot, daemon/tls: fix lint warnings

parent 33601c4c
......@@ -820,7 +820,7 @@ struct tls_client_paramlist_entry *tls_client_try_upgrade(map_t *tls_client_para
}
/* Rewrite 053 -> 853 */
strcpy(key + keylen - 3, "853");
memcpy(key + keylen - 4, "853", 3);
return map_get(tls_client_paramlist, key);
}
......
......@@ -2,8 +2,7 @@
-- util functions
--------------------------------------------------------------------------------
local function divide_string( str, max, fillChar )
fillChar = fillChar or ""
local function divide_string( str, max )
local result = {}
local start = 1
......@@ -77,7 +76,7 @@ function basexx.to_bit( str )
return ( str:gsub( '.', function ( c )
local byte = string.byte( c )
local bits = {}
for i = 1,8 do
for _ = 1,8 do
table.insert( bits, byte % 2 )
byte = math.floor( byte / 2 )
end
......@@ -132,7 +131,7 @@ local function to_basexx( str, alphabet, bits, pad )
local chunks = divide_string( bitString, bits )
local result = {}
for key,value in ipairs( chunks ) do
for _,value in ipairs( chunks ) do
if ( #value < bits ) then
value = value .. string.rep( '0', bits - #value )
end
......@@ -141,7 +140,7 @@ local function to_basexx( str, alphabet, bits, pad )
end
table.insert( result, pad )
return table.concat( result )
return table.concat( result )
end
--------------------------------------------------------------------------------
......@@ -186,7 +185,7 @@ local base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"..
"abcdefghijklmnopqrstuvwxyz"..
"0123456789+/"
local base64PadMap = { "", "==", "=" }
function basexx.from_base64( str, ignore )
str = ignore_set( str, ignore )
return from_basexx( str, base64Alphabet, 6 )
......@@ -203,7 +202,7 @@ end
local url64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"..
"abcdefghijklmnopqrstuvwxyz"..
"0123456789-_"
function basexx.from_url64( str, ignore )
str = ignore_set( str, ignore )
return from_basexx( str, url64Alphabet, 6 )
......@@ -222,16 +221,16 @@ local function length_error( len, d )
end
local z85Decoder = { 0x00, 0x44, 0x00, 0x54, 0x53, 0x52, 0x48, 0x00,
0x4B, 0x4C, 0x46, 0x41, 0x00, 0x3F, 0x3E, 0x45,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x40, 0x00, 0x49, 0x42, 0x4A, 0x47,
0x51, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A,
0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,
0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
0x3B, 0x3C, 0x3D, 0x4D, 0x00, 0x4E, 0x43, 0x00,
0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
0x4B, 0x4C, 0x46, 0x41, 0x00, 0x3F, 0x3E, 0x45,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x40, 0x00, 0x49, 0x42, 0x4A, 0x47,
0x51, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A,
0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,
0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
0x3B, 0x3C, 0x3D, 0x4D, 0x00, 0x4E, 0x43, 0x00,
0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
0x21, 0x22, 0x23, 0x4F, 0x00, 0x50, 0x00, 0x00 }
function basexx.from_z85( str, ignore )
......
......@@ -8,7 +8,6 @@ local C = ffi.C
local M = {}
M.layer = {}
local base32 = {}
local base64 = {}
local str = {}
local AF_INET = 2
local AF_INET6 = 10
......@@ -93,14 +92,14 @@ function M.layer.consume(state, _, pkt)
if name == name_add then
local addrbuf
if rr_add.type == kres.type.A then
ns_addr = ffi.new("struct sockaddr_in")
local ns_addr = ffi.new("struct sockaddr_in")
ns_addr.sin_family = AF_INET
ns_addr.sin_addr.s_addr = rr_add.rdata
addrbuf = ffi.new("char[?]", INET_ADDRSTRLEN)
C.inet_ntop(AF_INET, ns_addr.sin_addr, addrbuf, INET_ADDRSTRLEN)
else
ns_addr = ffi.new("struct sockaddr_in6")
local ns_addr = ffi.new("struct sockaddr_in6")
ns_addr.sin6_family = AF_INET6
ns_addr.sin6_addr.s6_addr = rr_add.rdata
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment