Title: Issue · GitHub
Open Graph Title: Issue · etr/libhttpserver
X Title: Issue · etr/libhttpserver
Description: C++ library for creating an embedded Rest HTTP server (and more) - Issue · etr/libhttpserver
Open Graph Description: C++ library for creating an embedded Rest HTTP server (and more) - Issue · etr/libhttpserver
X Description: C++ library for creating an embedded Rest HTTP server (and more) - Issue · etr/libhttpserver
Opengraph URL: https://github.com/etr/libhttpserver
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test crashes when using empty GET parameter","articleBody":"The test program (and others, too) crashes when used in the following way:\n./Test \u0026\ncurl http://localhost:8080?asdf\nFast fix as I am not a C++ expert:\n\n```\ndiff --git a/src/webserver.cpp b/src/webserver.cpp\nindex 9858bff..a0ea97f 100644\n--- a/src/webserver.cpp\n+++ b/src/webserver.cpp\n@@ -749,9 +749,16 @@ int webserver::build_request_args (\n void *cls,\n enum MHD_ValueKind kind,\n const char *key,\n- const char *value\n+ const char *orig_value\n )\n {\n+ int size;\n+ char *value;\n+ if (orig_value == NULL)\n+ value = (char*) \"\";\n+ else\n+ value = (char*) orig_value;\n+\n details::modded_request* mr = static_cast\u003cdetails::modded_request*\u003e(cls);\n {\n char buf[strlen(key) + strlen(value) + 3];\n@@ -766,7 +773,11 @@ int webserver::build_request_args (\n mr-\u003edhr-\u003equerystring += string(buf);\n }\n }\n- int size = internal_unescaper((void*) mr-\u003ews, (char*) value);\n+\n+ if (orig_value == NULL)\n+ size = 0;\n+ else\n+ size = internal_unescaper((void*) mr-\u003ews, value);\n mr-\u003edhr-\u003eset_arg(key, string(value, size));\n return MHD_YES;\n }\n\n```\n","author":{"url":"https://github.com/btwotch","@type":"Person","name":"btwotch"},"datePublished":"2014-03-03T22:04:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/44/libhttpserver/issues/44"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:e6e01962-99e6-94f7-1d59-67750c2b04c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8766:2AB90B:A7EC4A:DFF350:6A531ABF |
| html-safe-nonce | 0be5d3f082b0d246b9944bbfdbe418ef17cfc75db56ed9acea3dc8d61ffc6634 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzY2OjJBQjkwQjpBN0VDNEE6REZGMzUwOjZBNTMxQUJGIiwidmlzaXRvcl9pZCI6IjU1ODIwNjgyNTM2NDIxMzYyNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f6021f254b939a6111e90f124cd8449597dec302f5ef8805f9c20a6f22c6a414 |
| hovercard-subject-tag | repository:3416891 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/etr/libhttpserver/issues/44 |
| twitter:image | https://opengraph.githubassets.com/a3b1a99ff2c031de24bfb68f653603d237c1877fa645dbd644d0abd5c67842ea/etr/libhttpserver |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a3b1a99ff2c031de24bfb68f653603d237c1877fa645dbd644d0abd5c67842ea/etr/libhttpserver |
| og:image:alt | C++ library for creating an embedded Rest HTTP server (and more) - Issue · etr/libhttpserver |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-cache |
| go-import | github.com/etr/libhttpserver git https://github.com/etr/libhttpserver.git |
| octolytics-dimension-user_id | 1201536 |
| octolytics-dimension-user_login | etr |
| octolytics-dimension-repository_id | 3416891 |
| octolytics-dimension-repository_nwo | etr/libhttpserver |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3416891 |
| octolytics-dimension-repository_network_root_nwo | etr/libhttpserver |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width