Bugfix/codeql initial fixes (#195)
* Fix to BVLC6 bounds checking * Convert MSTP capture to use datetime library * Convert timesync app to use datetime and mstimer library * fix workflow per warning * fix BSD mstimer init function name Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Makefile to build BACnet Application
|
||||
#Makefile to build BACnet Application
|
||||
|
||||
# Executable file name
|
||||
TARGET = mstpcap
|
||||
@@ -8,13 +8,16 @@ TARGET = mstpcap
|
||||
SRCS = main.c \
|
||||
${BACNET_PORT_DIR}/rs485.c \
|
||||
${BACNET_PORT_DIR}/mstimer-init.c \
|
||||
${BACNET_PORT_DIR}/datetime-init.c \
|
||||
${BACNET_SRC_DIR}/bacnet/bacdcode.c \
|
||||
${BACNET_SRC_DIR}/bacnet/bacint.c \
|
||||
${BACNET_SRC_DIR}/bacnet/bacreal.c \
|
||||
${BACNET_SRC_DIR}/bacnet/bacstr.c \
|
||||
${BACNET_SRC_DIR}/bacnet/iam.c \
|
||||
${BACNET_SRC_DIR}/bacnet/datetime.c \
|
||||
${BACNET_SRC_DIR}/bacnet/indtext.c \
|
||||
${BACNET_SRC_DIR}/bacnet/npdu.c \
|
||||
${BACNET_SRC_DIR}/bacnet/basic/sys/days.c \
|
||||
${BACNET_SRC_DIR}/bacnet/basic/sys/debug.c \
|
||||
${BACNET_SRC_DIR}/bacnet/basic/sys/fifo.c \
|
||||
${BACNET_SRC_DIR}/bacnet/basic/sys/filename.c \
|
||||
|
||||
+6
-6
@@ -42,6 +42,7 @@
|
||||
#include "bacnet/bytes.h"
|
||||
#include "bacnet/iam.h"
|
||||
#include "bacnet/version.h"
|
||||
#include "bacnet/datetime.h"
|
||||
/* basic datalink, timer, and filename */
|
||||
#include "bacnet/datalink/dlmstp.h"
|
||||
#include "bacnet/basic/sys/mstimer.h"
|
||||
@@ -532,15 +533,14 @@ static size_t data_write_header(
|
||||
|
||||
static void filename_create(char *filename)
|
||||
{
|
||||
time_t my_time;
|
||||
struct tm *today;
|
||||
BACNET_DATE bdate;
|
||||
BACNET_TIME btime;
|
||||
|
||||
if (filename) {
|
||||
my_time = time(NULL);
|
||||
today = localtime(&my_time);
|
||||
datetime_local(&bdate, &btime, NULL, NULL);
|
||||
sprintf(filename, "mstp_%04d%02d%02d%02d%02d%02d.cap",
|
||||
1900 + today->tm_year, 1 + today->tm_mon, today->tm_mday,
|
||||
today->tm_hour, today->tm_min, today->tm_sec);
|
||||
(int)bdate.year, (int)bdate.month, (int)bdate.day,
|
||||
(int)btime.hour, (int)btime.min, (int)btime.sec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user