Skip to content

Commit 3fcd71b

Browse files
committed
utils: Mark base64 table as non-string data
Add the `__attribute__ ((__nonstring__))` to the base64 character lookup table. Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent e72dd07 commit 3fcd71b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libcrun/utils.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2357,11 +2357,17 @@ append_paths (char **out, libcrun_error_t *err, ...)
23572357
return 0;
23582358
}
23592359

2360+
#if __has_attribute(__nonstring__)
2361+
# define __nonstring __attribute__ ((__nonstring__))
2362+
#else
2363+
# define __nonstring
2364+
#endif
2365+
23602366
/* Adapted from mailutils 0.6.91 (distributed under LGPL 2.0+) */
23612367
static int
23622368
b64_input (char c)
23632369
{
2364-
const char table[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2370+
const char table[64] __nonstring = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
23652371
int i;
23662372

23672373
for (i = 0; i < 64; i++)

0 commit comments

Comments
 (0)