Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 1893b4a

Browse files
committed
HTTP: Correctly check snprintf() return value.
Signed-off-by: Guilherme Iscaro <guilherme.iscaro@intel.com>
1 parent 23eaa0b commit 1893b4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/comms/sol-http-server-impl-microhttpd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ get_default_response(const struct sol_http_server *server, enum sol_http_status_
454454
}
455455

456456
r = snprintf(buf, sizeof(buf), "status - %d", error);
457-
if (r < 0 || r > (int)sizeof(buf)) {
457+
if (r < 0 || r >= (int)sizeof(buf)) {
458458
SOL_WRN("Could not set the status code on response body");
459459
response = MHD_create_response_from_buffer(0, NULL, MHD_RESPMEM_PERSISTENT);
460460
} else {

0 commit comments

Comments
 (0)