Improve bounds checking

No particular crashes, but replace strcpy / strncpy with snprintf
and GLib functions wherever possible.
This commit is contained in:
Evan Miller
2020-12-28 20:12:39 -05:00
parent 31d8bc13aa
commit 2bb31f05ee
11 changed files with 42 additions and 54 deletions

View File

@@ -100,7 +100,7 @@ int mdb_test_int(MdbSargNode *node, gint32 i)
static double poor_mans_trunc(double x)
{
char buf[16];
sprintf(buf, "%.6f", x);
snprintf(buf, sizeof(buf), "%.6f", x);
sscanf(buf, "%lf", &x);
return x;
}