I was curious about what exactly a pointer holds, after malloc() was used to allocate memory space? The manpage tells me that calloc() initializes
No, malloc() returns uninitialized memory, the contents of which is indeterminate. So, attempt to use the value invokes undefined behavior.
Quoting C11, annex §J.2, Undefined behavior
The value of the object allocated by the
mallocfunction is used
In this case, %s expects a null-terminated char array. However, the content of dynamic_chars is indeterminate, so there may very well be no null-terminator, at all, which will cause the out-of-bound memory access, which in turn invokes the UB.
Quoting C11, chapter §7.22.3.5, The malloc function (emphasis mine):
The
mallocfunction allocates space for an object whose size is specified bysizeand whose value is indeterminate.
That said, please see this discussion on why not to cast the return value of malloc() and family in C..