Skip to content

Commit 7f7dd8d

Browse files
committed
in progress
Signed-off-by: Helge Wehder <[email protected]>
1 parent e20e4db commit 7f7dd8d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: OpenSSF project contributors
2+
# SPDX-License-Identifier: MIT
3+
"""Non-compliant Code Example"""
4+
5+
6+
class pallet:
7+
"""_Fake Euro Pallet"""
8+
9+
pallet_weight_kg: int = 25
10+
max_weight_in_kg: int = 1500
11+
weight_kg: int = 0
12+
13+
def __init__(self):
14+
self.weight_kg = self.pallet_weight_kg
15+
16+
def add_box(self, kg: str):
17+
self.weight_kg += int(kg)
18+
19+
def get_total(self):
20+
return str(self.weight_kg)
21+
22+
23+
#####################
24+
# Trying to exploit above code example
25+
#####################
26+
p = pallet()
27+
p.add_box(kg="100")
28+
print(p.get_total())
29+
p.add_box("100.0")
30+
print(p.get_total())

0 commit comments

Comments
 (0)