Skip to content

Commit c14ce9e

Browse files
committed
sdjournal: lock access to function pointers map
Maps are not safe for concurrent use in go.
1 parent 2d44d43 commit c14ce9e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sdjournal/journal.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ func (m *Match) String() string {
261261
}
262262

263263
func (j *Journal) getFunction(name string) (unsafe.Pointer, error) {
264+
j.mu.Lock()
265+
defer j.mu.Unlock()
264266
f, ok := libsystemdFunctions[name]
265267
if !ok {
266268
var err error

0 commit comments

Comments
 (0)