Ticket #10226: 0001-Fixed-resource-leak-and-possible-strings-corruption.patch

File 0001-Fixed-resource-leak-and-possible-strings-corruption.patch, 1.4 KB (added by Ezodev, 6 years ago)
  • src/system/kernel/vm/VMAnonymousCache.cpp

    From 5cc8e219002cb1c4f6fce0b4ab1dd4f609eb4e5f Mon Sep 17 00:00:00 2001
    From: Ezo <ezo.dev@gmail.com>
    Date: Wed, 20 Nov 2013 22:01:21 +0000
    Subject: [PATCH] Fixed resource leak and possible strings corruption
    
    ---
     src/system/kernel/vm/VMAnonymousCache.cpp | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/src/system/kernel/vm/VMAnonymousCache.cpp b/src/system/kernel/vm/VMAnonymousCache.cpp
    index d0337ba..7d3c0d8 100644
    a b swap_init_post_modules() 
    14841484                    // User specified a size / volume that seems valid
    14851485                    swapAutomatic = false;
    14861486                    swapSize = atoll(size);
    1487                     strncpy(selectedVolume.name, volume,
     1487                    strlcpy(selectedVolume.name, volume,
    14881488                        sizeof(selectedVolume.name));
    1489                     strncpy(selectedVolume.device, device,
     1489                    strlcpy(selectedVolume.device, device,
    14901490                        sizeof(selectedVolume.device));
    1491                     strncpy(selectedVolume.filesystem, filesystem,
     1491                    strlcpy(selectedVolume.filesystem, filesystem,
    14921492                        sizeof(selectedVolume.filesystem));
    14931493                    selectedVolume.capacity = atoll(capacity);
    14941494                } else {
    swap_init_post_modules() 
    14981498                        "using automatic swap\n", __func__);
    14991499                }
    15001500            }
    1501             unload_driver_settings(settings);
    15021501        }
     1502        unload_driver_settings(settings);
    15031503    }
    15041504
    15051505    if (swapAutomatic) {