Code Monkey home page Code Monkey logo

Comments (4)

koddr avatar koddr commented on May 1, 2024 1

OK, issue closed, but what's decision do you have? ๐Ÿ˜‰

I mean, it's normal to have this issues now (Fiber is too young), but if we can use external tools (like gosec) for checking security (an not so) issues at code and save our users โ€” let's do it! ๐Ÿ˜€

This is some info about G103 (CWE-242) issue:

  1. https://securego.io/docs/rules/g103.html
  2. https://go101.org/article/unsafe.html

I fixed two similar issues at #4, but I need help, because I'm not author of Fiber, unfortunately, and don't know why it's important to use unsafe.Pointer()...

from fiber.

Fenny avatar Fenny commented on May 1, 2024 1

@koddr , Fiber is build on Fasthttp and it use the same method to convert bytes to strings and vice-versa. https://github.com/valyala/fasthttp/blob/master/bytesconv.go#L332

So changing this won't matter since it's still being used by the fasthttp engine. I think adding the // #nosec G103 and a description should be fine ๐Ÿ‘

from fiber.

Fenny avatar Fenny commented on May 1, 2024

@koddr Thanks for your contribution!
I merged your pull request and addressed your gosec report in the source.

unsafe.Pointer() is used to convert a byte slice to a string without memory allocation.

from fiber.

koddr avatar koddr commented on May 1, 2024

@Fenny thx for awesome framework, btw ๐Ÿ˜ƒ

unsafe.Pointer() is used to convert a byte slice to a string without memory allocation.

Potentially, how we can solve this? Or not any other ways to do this (so easy as unsafe)?
I will go deep to this issue ๐Ÿ‘Œ

from fiber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.