Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kioubit committed Dec 24, 2021
1 parent bef2b5d commit ce659c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func WaitForSignal() {
}

func main() {
fmt.Println("PNDPD Version 0.8 - Kioubit 2021")
fmt.Println("PNDPD Version 0.9 - Kioubit 2021")

if len(os.Args) <= 2 {
printUsage()
Expand Down
2 changes: 1 addition & 1 deletion pndp/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func checksumAddition(b []byte) uint32 {
var sum uint32 = 0
for i := 0; i < len(b); i++ {
if i%2 == 0 {
if len(b) == i-1 {
if len(b) <= i-1 {
sum += uint32(uint16(b[i])<<8 | uint16(0x0))
} else {
sum += uint32(uint16(b[i])<<8 | uint16(b[i+1]))
Expand Down

0 comments on commit ce659c3

Please sign in to comment.