mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 06:30:58 +08:00
initializing memory before copying to the buffer for getExeDir()
This commit is contained in:
@@ -30,8 +30,9 @@ namespace alpr
|
|||||||
return directory;
|
return directory;
|
||||||
#else
|
#else
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
|
memset(buffer, 0, sizeof(buffer));
|
||||||
|
|
||||||
readlink("/proc/self/exe", buffer, 2048);
|
readlink("/proc/self/exe", buffer, sizeof(buffer));
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << buffer;
|
ss << buffer;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#ifndef OPENALPR_PLATFORM_H
|
#ifndef OPENALPR_PLATFORM_H
|
||||||
#define OPENALPR_PLATFORM_H
|
#define OPENALPR_PLATFORM_H
|
||||||
|
|
||||||
#include <string>
|
#include <string.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
|
Reference in New Issue
Block a user