diff --git a/bbs/subedit.cpp b/bbs/subedit.cpp index d4ac5f457..145e20fd8 100644 --- a/bbs/subedit.cpp +++ b/bbs/subedit.cpp @@ -333,8 +333,9 @@ static void modify_sub(int n) { if (a()->subs().sub(n).name == "** New WWIV Message Sub **") { a()->subs().sub(n).name = a()->subs().sub(n).desc; } - if (a()->subs().sub(n).filename == "NONAME") { - a()->subs().sub(n).filename = a()->subs().sub(n).nets[0].stype; + const auto stype = a()->subs().sub(n).nets[0].stype; + if (a()->subs().sub(n).filename == "NONAME" && stype.size() <= 8) { + a()->subs().sub(n).filename = stype; } } else if (ch2 == 'D' || ch2 == 'M') { bout.nl(); diff --git a/sdk/subxtr.cpp b/sdk/subxtr.cpp index 89c2ba302..bdca5fedc 100644 --- a/sdk/subxtr.cpp +++ b/sdk/subxtr.cpp @@ -325,11 +325,18 @@ bool Subs::Save() { std::vector xsubs; for (const auto& s : subs_) { - subboardrec_422_t ls = {}; - xtrasubsrec lx = {}; - to_char_array(ls.name, s.name); - to_char_array(lx.desc, s.desc); - to_char_array(ls.filename, s.filename); + // Only copy over what data fits in the old format. + subboardrec_422_t ls{}; + xtrasubsrec lx{}; + if (s.name.size() < sizeof ls.name) { + to_char_array(ls.name, s.name); + } + if (s.desc.size() < sizeof lx.desc) { + to_char_array(lx.desc, s.desc); + } + if (s.filename.size() < sizeof ls.filename) { + to_char_array(ls.filename, s.filename); + } ls.key = s.key; ls.readsl = s.readsl; ls.postsl = s.postsl;