Skip to content

Commit fc56ad8

Browse files
committed
ovsnl: ignore gosec rule G103 for now
This will be fixed in a follow-up
1 parent ec0d519 commit fc56ad8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ovsnl/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (c *Client) initFamily(f genetlink.Family) error {
119119

120120
// headerBytes converts an ovsh.Header into a byte slice.
121121
func headerBytes(h ovsh.Header) []byte {
122-
b := *(*[sizeofHeader]byte)(unsafe.Pointer(&h))
122+
b := *(*[sizeofHeader]byte)(unsafe.Pointer(&h)) // #nosec G103
123123
return b[:]
124124
}
125125

@@ -130,6 +130,6 @@ func parseHeader(b []byte) (ovsh.Header, error) {
130130
return ovsh.Header{}, fmt.Errorf("not enough data for OVS message header: %d bytes", l)
131131
}
132132

133-
h := *(*ovsh.Header)(unsafe.Pointer(&b[:sizeofHeader][0]))
133+
h := *(*ovsh.Header)(unsafe.Pointer(&b[:sizeofHeader][0])) // #nosec G103
134134
return h, nil
135135
}

ovsnl/datapath.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func parseDPStats(b []byte) (DatapathStats, error) {
173173
return DatapathStats{}, fmt.Errorf("unexpected datapath stats structure size, want %d, got %d", want, got)
174174
}
175175

176-
s := *(*ovsh.DPStats)(unsafe.Pointer(&b[0]))
176+
s := *(*ovsh.DPStats)(unsafe.Pointer(&b[0])) // #nosec G103
177177
return DatapathStats{
178178
Hit: s.Hit,
179179
Missed: s.Missed,
@@ -190,7 +190,7 @@ func parseDPMegaflowStats(b []byte) (DatapathMegaflowStats, error) {
190190
return DatapathMegaflowStats{}, fmt.Errorf("unexpected datapath megaflow stats structure size, want %d, got %d", want, got)
191191
}
192192

193-
s := *(*ovsh.DPMegaflowStats)(unsafe.Pointer(&b[0]))
193+
s := *(*ovsh.DPMegaflowStats)(unsafe.Pointer(&b[0])) // #nosec G103
194194

195195
return DatapathMegaflowStats{
196196
MaskHits: s.Mask_hit,

ovsnl/datapath_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ func mustMarshalDatapath(dp Datapath) []byte {
186186
Flows: dp.Stats.Flows,
187187
}
188188

189-
sb := *(*[sizeofDPStats]byte)(unsafe.Pointer(&s))
189+
sb := *(*[sizeofDPStats]byte)(unsafe.Pointer(&s)) // #nosec G103
190190

191191
ms := ovsh.DPMegaflowStats{
192192
Mask_hit: dp.MegaflowStats.MaskHits,
193193
Masks: dp.MegaflowStats.Masks,
194194
// Pad already set to zero.
195195
}
196196

197-
msb := *(*[sizeofDPMegaflowStats]byte)(unsafe.Pointer(&ms))
197+
msb := *(*[sizeofDPMegaflowStats]byte)(unsafe.Pointer(&ms)) // #nosec G103
198198

199199
ab := mustMarshalAttributes([]netlink.Attribute{
200200
{

0 commit comments

Comments
 (0)