diff --git a/internal/compact_lang_det_hint_code.cc b/internal/compact_lang_det_hint_code.cc index fc1f0ae..6c352e7 100644 --- a/internal/compact_lang_det_hint_code.cc +++ b/internal/compact_lang_det_hint_code.cc @@ -1448,6 +1448,8 @@ void SetCLDTLDHint(const char* tld, CLDLangPriors* langpriors) { if (len > 3) {return;} // Ignore if more than three letters char local_tld[4]; strncpy(local_tld, tld, len); + local_tld[3] = '\0'; // Safety move + // Lowercase for (int i = 0; i < len; ++i) {local_tld[i] |= 0x20;} const TLDLookup* entry = DoTLDLookup(local_tld, kCLDTLDHintTable,