Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/matej-chmel/go-linked-list
Generic library for singly and doubly linked lists.
go get github.com/Matej-Chmel/go-linked-list@v1.0.3
package main
import (
"fmt"
lk "github.com/Matej-Chmel/go-linked-list"
)
func main() {
// Easy construction
singleHead := lk.CreateSinglyLinkedList(1, 2, 3)
doubleHead := lk.CreateDoublyLinkedList[int8](10, 20, 30)
// Conversion to string
fmt.Println(singleHead)
fmt.Println(doubleHead)
node := singleHead
sum := 0
for node != nil {
// Each node has Next and Val fields
sum += node.Val
node = node.Next
}
fmt.Println("Sum:", sum)
// Doubly linked list can be iterated backwards
current := doubleHead.GetLast()
total := int8(0)
for current != nil {
total += current.Val
current = current.Prev
}
fmt.Println("Total:", total)
// Conversion to string can be customized
symbols := lk.NewFormatSymbols(true)
symbols.Start = "("
symbols.Sep = ", "
symbols.End = ")"
fmt.Println(singleHead.Format(symbols))
}
[1 > 2 > 3]
[10 <> 20 <> 30]
Sum: 6
Total: 60
(1, 2, 3)
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.