Giter Site home page Giter Site logo

armink-rtt-pkgs / easylogger Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 13.0 27 KB

A ultra-lightweight(ROM<1.6K, RAM<0.3k), high-performance C/C++ log library. | 一款超轻量级(ROM<1.6K, RAM<0.3k)、高性能的 C/C++ 日志库

License: MIT License

Python 0.63% C 93.87% C++ 5.50%

easylogger's People

Contributors

armink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

easylogger's Issues

log_index2addr 函数存在隐藏风险,建议优化

ef_log.c 文件内的 log_index2addr 函数使用存在隐藏风险,建议可以优化

当给 log_index2addr 传入的参数index 的值 大于 2倍LOG_AREA_SIZE时,回导致计算出来的flash物理地址错误

建议将返回值计算
return log_start_addr + index + header_total_offset - LOG_AREA_SIZE;
修改为
return (log_start_addr + index + header_total_offse)t % LOG_AREA_SIZE;

尽管此函数仅由ef_log_read调用,且ef_log_read函数内做了EF_ASSERT(index < cur_using_size);判断,目前整体是安全的,但是此函数是不安全的,为防止后续其他函数调用是引入风险,建议修改

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.