aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-16 11:16:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-16 11:16:38 +0100
commit8f367144e8772a209a5f0b6133c601d5db69ce6c (patch)
tree8a35ed0542a8cf661731c2a8f0ab6b1812a9a6e3
parent8238a25077f93f027119defe5dd010d3284e85de (diff)
downloadrspamd-8f367144e8772a209a5f0b6133c601d5db69ce6c.tar.gz
rspamd-8f367144e8772a209a5f0b6133c601d5db69ce6c.zip
[Minor] Use own base64 decode procedure
-rw-r--r--src/lua/lua_util.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index f385b3ef2..7ff9d75f8 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -1037,8 +1037,7 @@ lua_util_decode_base64 (lua_State *L)
LUA_TRACE_POINT;
struct rspamd_lua_text *t;
const gchar *s = NULL;
- gsize inlen, outlen;
- gboolean zero_copy = FALSE, grab_own = FALSE;
+ gsize inlen = 0, outlen;
gint state = 0;
guint save = 0;
@@ -1055,31 +1054,15 @@ lua_util_decode_base64 (lua_State *L)
}
if (s != NULL) {
- if (zero_copy) {
- /* Decode in place */
- outlen = g_base64_decode_step (s, inlen, (guchar *)s, &state, &save);
- t = lua_newuserdata (L, sizeof (*t));
- rspamd_lua_setclass (L, "rspamd{text}", -1);
- t->start = s;
- t->len = outlen;
+ t = lua_newuserdata (L, sizeof (*t));
+ rspamd_lua_setclass (L, "rspamd{text}", -1);
+ t->len = (inlen / 4) * 3 + 3;
+ t->start = g_malloc (t->len);
- if (grab_own) {
- t->flags |= RSPAMD_TEXT_FLAG_OWN;
- }
- else {
- t->flags = 0;
- }
- }
- else {
- t = lua_newuserdata (L, sizeof (*t));
- rspamd_lua_setclass (L, "rspamd{text}", -1);
- t->len = (inlen / 4) * 3 + 3;
- t->start = g_malloc (t->len);
- outlen = g_base64_decode_step (s, inlen, (guchar *)t->start,
- &state, &save);
- t->len = outlen;
- t->flags = RSPAMD_TEXT_FLAG_OWN;
- }
+ rspamd_cryptobox_base64_decode (s, inlen, (guchar *)t->start,
+ &outlen);
+ t->len = outlen;
+ t->flags = RSPAMD_TEXT_FLAG_OWN;
}
else {
lua_pushnil (L);
n> Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/l10n/es_CO.js
blob: 620d498f6048904e5b3cb39fd87c4a664b4ac5e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115