mrdotx / cinfo Goto Github PK
View Code? Open in Web Editor NEWa fast and minimal system information tool for linux-based operating systems
License: GNU General Public License v3.0
a fast and minimal system information tool for linux-based operating systems
License: GNU General Public License v3.0
cinfo.c:47:13: error: Width 64 given in format string (no. 1) is larger than destination buffer 'g_host[50]', use %49s to prevent overflowing it. [invalidScanfFormatWidth]
Source code is
if (fscanf(file, "%64s", g_host)) {
but
g_host[50],
If you'll add versioning and/or tags I will package this for Fedora/EPEL :)
From build output.
cinfo.c: In function 'get_mem':
cinfo.c:347:76: warning: ']' directive writing 1 byte into a region of size between 0 and 31 [-Wformat-overflow=]
347 | sprintf(g_mem, "%dMiB%s%dMiB [%.1f%%]%s%dMiB%s%dMiB [%.1f%%]", \
cinfo.c: In function 'get_cpu':
cinfo.c:225:29: warning: '%s' directive writing up to 255 bytes into a region of size 47 [-Wformat-overflow=]
225 | "%s/%s", CPU_TEMP_PATH, entry->d_name);
| ^~
cinfo.c: In function 'get_cpu':
cinfo.c:227:26: warning: '%s' directive writing up to 63 bytes into a region of size 48 [-Wformat-overflow=]
227 | "%s/name", temp_path);
| ^~ ~~~~~~~~~
In function 'sprintf',
inlined from 'get_cpu' at cinfo.c:226:17:
/usr/include/bits/stdio2.h:30:10: note: '__sprintf_chk' output between 6 and 69 bytes into a destination of size 48
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
cinfo.c: In function 'get_cpu':
cinfo.c:263:35: warning: ' [' directive writing 2 bytes into a region of size between 1 and 65 [-Wformat-overflow=]
263 | sprintf(g_cpu, "%s [%.1f%s]", g_cpu, temp, CPU_TEMP);
| ^~
In function 'sprintf',
inlined from 'get_cpu' at cinfo.c:263:17:
/usr/include/bits/stdio2.h:30:10: note: '__sprintf_chk' output between 9 and 382 bytes into a destination of size 65
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
There are some other instances as well.
This can be recreated by building with -Wformat-overflow
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.