Potential fix for pull request finding 'CodeQL / Log entries created from user input'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Tobias Gesellchen
2026-06-02 23:00:58 +02:00
co-authored by lnx01
parent 44d16e54da
commit a16dcd5e56
+6 -1
View File
@@ -566,7 +566,12 @@ func (ws *WebSocketClient) handleEvent(event *models.WebSocketEvent) {
// Log the actual unmodeled element names (e.g. nowSelectionUpdated)
// rather than an empty list; skip frames that carry no child events.
if names := event.UnknownEventNames(); len(names) > 0 {
ws.logger.Printf("Received unhandled event types: %v", names)
sanitizedNames := make([]string, 0, len(names))
for _, name := range names {
sanitizedNames = append(sanitizedNames, sanitizeLog(name))
}
ws.logger.Printf("Received unhandled event types: %v", sanitizedNames)
}
}
}