Use length-bounded string/memory functions (#7709)

Resolves #3949 by replacing all calls to sprintf() and strcpy() in first-party code with calls to snprintf() or some other reasonable alternative.
This commit is contained in:
Fawn
2025-10-23 12:58:32 -07:00
committed by GitHub
parent 44a68b8b01
commit 0fcd67f911
5 changed files with 115 additions and 148 deletions

View File

@@ -26,7 +26,8 @@
#ifndef LMMS_DRUM_SYNTH_H
#define LMMS_DRUM_SYNTH_H
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include "LmmsTypes.h"
@@ -48,8 +49,9 @@ private:
float waveform(float ph, int form);
int GetPrivateProfileString(
const char* sec, const char* key, const char* def, char* buffer, int size, QString file);
std::size_t GetPrivateProfileString(const char* sec,
const char* key, const char* def, char* buffer,
std::size_t size, QString file);
int GetPrivateProfileInt(const char* sec, const char* key, int def, QString file);
float GetPrivateProfileFloat(const char* sec, const char* key, float def, QString file);
};