Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@milanjrodd
Copy link
Collaborator

No description provided.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

//world.PatchReset()
//log.Printf("%v", patch)
if network.Quic.Mode() != network.ModeNone {
network.Quic.Send([]byte("patch"), 0)

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
for v != 0 {
index := bits.TrailingZeros(v)
v &^= 1 << index
id = ComponentId(i*bits.UintSize + index)

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> uint16

func (e *Entity) SetVersion(version EntityVersion) {
assert.True(version <= MaxEntityGenerationId, "version is too high")
*e = Entity(entityType(*e) - entityType(e.GetVersion()<<(entityPower-generationPower)) | entityType(version)<<(entityPower-generationPower))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion uint -> uint32

func (e *Entity) SetVersion(version EntityVersion) {
assert.True(version <= MaxEntityGenerationId, "version is too high")
*e = Entity(entityType(*e) - entityType(e.GetVersion()<<(entityPower-generationPower)) | entityType(version)<<(entityPower-generationPower))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion uint -> uint32
// Iterate only set bits in mask
for mask != 0 {
// Get the least significant raised bit position
layer := stdcomponents.CollisionLayer(bits.TrailingZeros32(uint32(mask)))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> uint64
// Iterate only set bits in mask
for mask != 0 {
// Get the least significant raised bit position
layer := stdcomponents.CollisionLayer(bits.TrailingZeros32(uint32(mask)))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion uint64 -> uint32
c.Camera2D.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5))
fb := s.FrameBuffer2D.GetUnsafe(s.mainCamera)
rl.UnloadRenderTexture(fb.Texture)
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
c.Camera2D.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5))
fb := s.FrameBuffer2D.GetUnsafe(s.mainCamera)
rl.UnloadRenderTexture(fb.Texture)
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
c.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5))
fb := s.FrameBuffer2D.GetUnsafe(s.minimapCamera)
rl.UnloadRenderTexture(fb.Texture)
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
c.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5))
fb := s.FrameBuffer2D.GetUnsafe(s.minimapCamera)
rl.UnloadRenderTexture(fb.Texture)
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
s.monitorHeight = rl.GetScreenHeight()
fb := s.FrameBuffer2D.GetUnsafe(s.frameBuffer)
rl.UnloadRenderTexture(fb.Texture)
fb.Texture = rl.LoadRenderTexture(int32(s.monitorWidth), int32(s.monitorHeight))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
s.monitorHeight = rl.GetScreenHeight()
fb := s.FrameBuffer2D.GetUnsafe(s.frameBuffer)
rl.UnloadRenderTexture(fb.Texture)
fb.Texture = rl.LoadRenderTexture(int32(s.monitorWidth), int32(s.monitorHeight))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
textSize := rl.MeasureTextEx(rl.GetFontDefault(), text, 96, 0)
x := (s.monitorWidth - int(textSize.X)) / 2
y := (s.monitorHeight - int(textSize.Y)) / 2
rl.DrawText(text, int32(x), int32(y), 96, rl.Red)

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
textSize := rl.MeasureTextEx(rl.GetFontDefault(), text, 96, 0)
x := (s.monitorWidth - int(textSize.X)) / 2
y := (s.monitorHeight - int(textSize.Y)) / 2
rl.DrawText(text, int32(x), int32(y), 96, rl.Red)

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> int32
}

start := time.Now()
results, err := fn.Call(c.Context(), api.EncodeU32(uint32(a)), api.EncodeU32(uint32(b)))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> uint32
}

start := time.Now()
results, err := fn.Call(c.Context(), api.EncodeU32(uint32(a)), api.EncodeU32(uint32(b)))

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int -> uint32
}

func (nm *NodeManager) LoadWasm(ctx context.Context, file string) error {
wasm, err := os.ReadFile(file)

Check failure

Code scanning / gosec

Potential file inclusion via variable Error

Potential file inclusion via variable
var sizeOfGame = int(unsafe.Sizeof(game))
var getGameModule = Module{
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) {
gameBytes := unsafe.Slice((*byte)(unsafe.Pointer(&game)), sizeOfGame)

Check warning

Code scanning / gosec

Use of unsafe calls should be audited Warning

Use of unsafe calls should be audited
var sizeOfGame = int(unsafe.Sizeof(game))
var getGameModule = Module{
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) {
gameBytes := unsafe.Slice((*byte)(unsafe.Pointer(&game)), sizeOfGame)

Check warning

Code scanning / gosec

Use of unsafe calls should be audited Warning

Use of unsafe calls should be audited
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) {
gameRef := api.DecodeU32(stack[0])
r, _ := mod.Memory().Read(gameRef, uint32(unsafe.Sizeof(game)))
localGame := (*wasyan.Game)(unsafe.Pointer(unsafe.SliceData(r)))

Check warning

Code scanning / gosec

Use of unsafe calls should be audited Warning

Use of unsafe calls should be audited
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) {
gameRef := api.DecodeU32(stack[0])
r, _ := mod.Memory().Read(gameRef, uint32(unsafe.Sizeof(game)))
localGame := (*wasyan.Game)(unsafe.Pointer(unsafe.SliceData(r)))

Check warning

Code scanning / gosec

Use of unsafe calls should be audited Warning

Use of unsafe calls should be audited
func set_game(gameRef uint32)

func GetGame(game *wasyan.Game) {
get_game(uint32(uintptr(unsafe.Pointer(game))))

Check warning

Code scanning / gosec

Use of unsafe calls should be audited Warning

Use of unsafe calls should be audited
}

func SetGame(game *wasyan.Game) {
set_game(uint32(uintptr(unsafe.Pointer(game))))

Check warning

Code scanning / gosec

Use of unsafe calls should be audited Warning

Use of unsafe calls should be audited
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants