You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead, get the string length, allocate enough for the whole thing, then memcpy it into place. And before any of that, check for null. Technically it's undefined to pass null for %s in the printf (FMQ_LOGGER), too.
$ curl -d @examples/sample.json http://0:8005/provider
The server crashes:
Starting server on http://localhost:8005
Received: (null)
tcp.c:71:5: runtime error: null pointer passed as argument 2, which is declared to never be null
Context:
data->message = malloc(sizeof(char) * 1024);
strcpy(data->message, message);
The text was updated successfully, but these errors were encountered:
From skeeto on Reddit:
Then in another terminal:
$ curl -d @examples/sample.json http://0:8005/provider
The server crashes:
The text was updated successfully, but these errors were encountered: