--- freem/src/ssvn.c 2025/01/19 02:04:04 1.1.1.1 +++ freem/src/ssvn.c 2025/04/09 15:16:50 1.4 @@ -1,23 +1,11 @@ /* - * * - * * * - * * * - * *************** - * * * * * - * * MUMPS * - * * * * * - * *************** - * * * - * * * - * * - * - * ssvn.c + * $Id: ssvn.c,v 1.4 2025/04/09 15:16:50 snw Exp $ * structured system variable support * * - * Author: Serena Willis + * Author: Serena Willis * Copyright (C) 1998 MUG Deutschland - * Copyright (C) 2020 Coherent Logic Development LLC + * Copyright (C) 2020, 2025 Coherent Logic Development LLC * * * This file is part of FreeM. @@ -35,6 +23,16 @@ * You should have received a copy of the GNU Affero Public License * along with FreeM. If not, see . * + * $Log: ssvn.c,v $ + * Revision 1.4 2025/04/09 15:16:50 snw + * Fix buffer overruns in mref_to_external and ssvn.c + * + * Revision 1.3 2025/03/09 19:50:47 snw + * Second phase of REUSE compliance and header reformat + * + * + * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC + * SPDX-License-Identifier: AGPL-3.0-or-later **/ #include @@ -117,7 +115,11 @@ void ssvn (short action, char *key, char int i, j; char ch; char ptmp[256]; + char sbuf[256]; + snprintf (sbuf, sizeof (sbuf), " C CHARACTER D DEVICE DI DISPLAY E EVENT G GLOBAL J JOB LI LIBRARY L LOCK O OBJECT P R ROUTINE S SYSTEM W WINDOW \201"); + + if ((rtn_dialect () == D_M77) || (rtn_dialect () == D_M84) || (rtn_dialect () == D_M90)) { @@ -151,7 +153,7 @@ void ssvn (short action, char *key, char if ((ptmp[1] != 'Z') && (ptmp[1] != 'Y')) { - if (find (" C CHARACTER D DEVICE DI DISPLAY E EVENT G GLOBAL J JOB LI LIBRARY L LOCK O OBJECT P R ROUTINE S SYSTEM W WINDOW ", ptmp) == FALSE) { + if (find (sbuf, ptmp) == FALSE) { merr_raise (M60); return; }