fault/fm-common/sources
SidneyAn 816f45e94d replace strncpy by snprintf
as for strncpy does not guarantee null terminated of dest string,
but snprintf does.

so change code from
    strncpy(buffer, source, sizeof buffer);
  to
    int n = snprintf(buffer, sizeof buffer, "%s", source);
    assert(n >= 0 && n < sizeof buffer);

test case:
  1. a simple test about difference between strncpy and snprintf
  2. use fmClientCli to create an alarm
     mock the init_tables() function so there is no need to
connect to the server.
     add code to dump SFmAlarmDataT to check datas return.
  3. one controller + one compute deploy (virtual)
     success deploy and create an instance.

Closes-Bug: 1794701

Change-Id: I04b4c5c85782ff571e2957e12c47f2f628d2b772
2018-11-03 00:56:57 +08:00
..
LICENSE StarlingX open source release updates 2018-05-31 07:36:00 -07:00
Makefile Make fm-common build a bit more portable 2018-08-23 17:42:28 -05:00
fmAPI.cpp StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmAPI.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmAlarm.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmAlarmUtils.cpp replace strncpy by snprintf 2018-11-03 00:56:57 +08:00
fmAlarmUtils.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmConfig.cpp Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmConfig.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmConstants.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmDb.cpp Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmDb.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmDbAPI.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmDbAlarm.cpp replace strncpy by snprintf 2018-11-03 00:56:57 +08:00
fmDbAlarm.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmDbEventLog.cpp replace strncpy by snprintf 2018-11-03 00:56:57 +08:00
fmDbEventLog.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmDbUtils.cpp Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmDbUtils.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmEventSuppression.cpp Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmEventSuppression.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmFile.cpp StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmFile.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmLog.cpp Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmLog.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmMsg.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmMsgServer.cpp Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmMsgServer.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmMutex.cpp StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmMutex.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmSnmpConstants.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmSnmpUtils.cpp Avoid null check for reference in fm_snmp_util_gen_trap 2018-08-22 23:35:29 -05:00
fmSnmpUtils.h Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fmSocket.cpp StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmSocket.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmThread.cpp StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmThread.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmTime.cpp StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fmTime.h StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fm_cli.cpp StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fm_db_sync_event_suppression.py Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
fm_python_mod_main.cpp Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
setup.py Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00