From e7f33ee2f1c57b2b5c48d1a54a5f9e4c72a3275c Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Mon, 21 Sep 2020 19:10:44 +0200 Subject: Settings: Fix crash on exit due to group double-free --- src/settings.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/settings.cpp b/src/settings.cpp index 55404319e..473a216bf 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -824,13 +824,21 @@ bool Settings::setDefault(const std::string &name, const std::string &value) bool Settings::setGroup(const std::string &name, Settings *group) { - return setEntry(name, &group, true, false); + // Settings must own the group pointer + // avoid double-free by copying the source + Settings *copy = new Settings(); + *copy = *group; + return setEntry(name, ©, true, false); } bool Settings::setGroupDefault(const std::string &name, Settings *group) { - return setEntry(name, &group, true, true); + // Settings must own the group pointer + // avoid double-free by copying the source + Settings *copy = new Settings(); + *copy = *group; + return setEntry(name, ©, true, true); } -- cgit v1.2.3 ='/minetest.git/about/?h=gpcf'>aboutsummaryrefslogtreecommitdiff
path: root/lib/lua/COPYRIGHT
blob: 3a53e741e0372e879886e1383ca604b57ed748d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Lua License
-----------

Lua is licensed under the terms of the MIT license reproduced below.
This means that Lua is free software and can be used for both academic
and commercial purposes at absolutely no cost.

For details and rationale, see http://www.lua.org/license.html .

===============================================================================

Copyright (C) 1994-2008 Lua.org, PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

===============================================================================

(end of COPYRIGHT)