diff --git a/cfg/cppcheck-cfg.rng b/cfg/cppcheck-cfg.rng
index 2d638920b..1339fbba7 100644
--- a/cfg/cppcheck-cfg.rng
+++ b/cfg/cppcheck-cfg.rng
@@ -32,6 +32,9 @@
+
+
+
@@ -458,6 +461,12 @@
+
+
+ arg-value:[1-3]
+
+
+
resize
diff --git a/cfg/std.cfg b/cfg/std.cfg
index 749d40c3d..f57921694 100644
--- a/cfg/std.cfg
+++ b/cfg/std.cfg
@@ -7320,7 +7320,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
- malloc
+ malloc
calloc
aligned_alloc
valloc
diff --git a/lib/library.cpp b/lib/library.cpp
index 4be26049e..56512aae6 100644
--- a/lib/library.cpp
+++ b/lib/library.cpp
@@ -200,6 +200,13 @@ Library::Error Library::load(const tinyxml2::XMLDocument &doc)
temp.arg = atoi(arg);
else
temp.arg = -1;
+
+ const char *bufferSize = memorynode->Attribute("buffer-size");
+ if (bufferSize && std::strncmp(bufferSize, "arg-value:", 10) == 0)
+ temp.bufferSizeArgValue = bufferSize[10] - '0';
+ else
+ temp.bufferSizeArgValue = -1;
+
mAlloc[memorynode->GetText()] = temp;
} else if (memorynodename == "dealloc") {
AllocFunc temp;
diff --git a/lib/library.h b/lib/library.h
index cd25eb254..508f970b9 100644
--- a/lib/library.h
+++ b/lib/library.h
@@ -73,6 +73,7 @@ public:
struct AllocFunc {
int groupId;
int arg;
+ int bufferSizeArgValue;
};
/** get allocation info for function */