mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
25 lines
748 B
Diff
25 lines
748 B
Diff
commit 61d3516bbfce6b4e6393825329c07b1e2a88d47d
|
|
Author: Michael Tremer <michael.tremer@ipfire.org>
|
|
Date: Mon Jul 13 10:47:30 2020 +0000
|
|
|
|
country: Terminate buffer when reading from database
|
|
|
|
Compilers on ARM do not seem to initialise the buffer.
|
|
|
|
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
|
|
|
|
diff --git a/src/country.c b/src/country.c
|
|
index d6ddf50..2ba93e6 100644
|
|
--- a/src/country.c
|
|
+++ b/src/country.c
|
|
@@ -125,6 +125,9 @@ int loc_country_new_from_database_v1(struct loc_ctx* ctx, struct loc_stringpool*
|
|
// Read country code
|
|
loc_country_code_copy(buffer, dbobj->code);
|
|
|
|
+ // Terminate buffer
|
|
+ buffer[2] = '\0';
|
|
+
|
|
// Create a new country object
|
|
int r = loc_country_new(ctx, country, buffer);
|
|
if (r)
|