Repository navigation
Commit 469071b
committed
ingress: fix crash when parsing from stdin
When injecting a single email or an mbox from stdin, ParseMail is
invoked with the wrong context object which does not have a reference to
the event bus.
This results in a NULL pointer dereference on Queries.Commit():
for _, e := range q.pendingEvents {
q.Events.Enqueue(&e) // q.Events is nil
}
Use the correct context object to fix the issue.
Add a panic() to ensure that transactions can never be started with
a nil event bus anymore.
Fixes: 82a9d25 ("ingress: pass context with event bus to SMTP mail parser")
Reported-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
Signed-off-by: Robin Jarry <robin@jarry.cc>1 parent 60bad79 commit 469071b
2 files changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
129 | 130 | | |
130 | | - | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
0 commit comments