Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 989cdd1

Browse files
authored
Merge pull request #1284 from starwarfan/mst-scan-fix
Fix code issues
2 parents 25a627c + 13c36f4 commit 989cdd1

File tree

2 files changed

+6
-3
lines changed
  • source
    • agent/sip/sipIn/sip_gateway/sipua/modules/zrtp
    • management_console

2 files changed

+6
-3
lines changed

source/agent/sip/sipIn/sip_gateway/sipua/modules/zrtp/zrtp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ static int module_init(void)
341341
"%s/zrtp_zid", config_path) < 0)
342342
return ENOMEM;
343343
if ((f = fopen(zrtp_zid_path, "rb")) != NULL) {
344-
if (fread(zrtp_config.zid, sizeof(zrtp_config.zid),
345-
1, f) != 1) {
344+
if (fgets(zrtp_config.zid, 1, f) == NULL) {
346345
if (feof(f) || ferror(f)) {
347346
warning("zrtp: invalid zrtp_zid file\n");
348347
}

source/management_console/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ app.use('/console', express.static(__dirname + '/public'));
3030
const session = require('express-session');
3131
const {v4: uuidv4} = require('uuid');
3232

33+
function createRandomHex(num) {
34+
return crypto.randomBytes(num).toString('hex');
35+
}
36+
3337
app.use(session({
34-
secret: 'servicesecret',
38+
secret: createRandomHex(32),
3539
name: 'owtserver',
3640
genid: function(req) {
3741
return uuidv4();

0 commit comments

Comments
 (0)