Skip to content

Commit 759ab42

Browse files
committed
fixing bug with eventing
1 parent cd3e5ed commit 759ab42

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

CHANGELOG.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.3.1-rc91] - 2025-08-24
8+
9+
### Changed
10+
11+
- Fixing bug with eventing causing issues with ints
12+
713
## [3.3.1-rc90] - 2025-08-21
814

915
### Changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.1-rc90
1+
3.3.1-rc91

mythic-docker/src/rabbitmq/eventing.go

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,19 +1115,34 @@ func replaceVariableInActionDataString(actionDataString string, key string, val
11151115

11161116
// starting a specific step action
11171117
func convertMapStringToInt(actionDataMap map[string]interface{}, key string, required bool) error {
1118-
if _, ok := actionDataMap[key]; ok {
1119-
callbackDisplayID := actionDataMap[key].(string)
1120-
intCallbackDisplayID, err := strconv.Atoi(callbackDisplayID)
1118+
value, exists := actionDataMap[key]
1119+
if !exists {
1120+
if required {
1121+
err := fmt.Sprintf("%s is required", key)
1122+
logging.LogError(nil, err)
1123+
return errors.New(err)
1124+
}
1125+
return nil
1126+
}
1127+
1128+
var intValue int
1129+
switch v := value.(type) {
1130+
case string:
1131+
var err error
1132+
intValue, err = strconv.Atoi(v)
11211133
if err != nil {
1122-
logging.LogError(err, "failed to convert callback_display_id to int")
11231134
return err
11241135
}
1125-
actionDataMap[key] = intCallbackDisplayID
1126-
} else if required {
1127-
err := fmt.Sprintf("%s is required", key)
1128-
logging.LogError(nil, err)
1129-
return errors.New(err)
1136+
case float64:
1137+
intValue = int(v)
1138+
case int:
1139+
intValue = v
1140+
default:
1141+
err := fmt.Errorf("unsupported type for key '%s': %T", key, v)
1142+
logging.LogError(nil, err.Error())
1143+
return err
11301144
}
1145+
actionDataMap[key] = intValue
11311146
return nil
11321147
}
11331148
func startEventStepInstanceActionCreatePayload(eventStepInstance databaseStructs.EventStepInstance, actionDataMap map[string]interface{}) error {

mythic-docker/src/utils/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/spf13/viper"
1212
)
1313

14-
const mythicServerVersion = "3.3.1-rc90"
14+
const mythicServerVersion = "3.3.1-rc91"
1515

1616
type Config struct {
1717
// server configuration

0 commit comments

Comments
 (0)