-
Notifications
You must be signed in to change notification settings - Fork 352
Open
Labels
Description
Hi.
The following operations can cause fegfault.
# conf.json
{
"listeners": {
"*:8080": {
"pass":"routes"
}
},
"routes": [
{
"match": {
"uri": "/"
},
"action": {
"share":"/tmp/html"
}
}
]
}
curl -X PUT -d '"/"' http://127.1:8000/config/routes/0/match/uri/0
curl -X PUT -d '"/"' http://127.1:8000/config/routes/0/match/uri/a
Here's the patch. Take a look, please.
# HG changeset patch
# User hongzhidao <[email protected]>
# Date 1577705904 -28800
# Node ID 1fcb5fba6ab659cd1f4be71b87b567c7b6769360
# Parent 96e6ac1926f86faf542cf380a8d2eadebd3eac5b
Fixed segfault happened in nxt_conf_op_compile().
diff -r 96e6ac1926f8 -r 1fcb5fba6ab6 src/nxt_conf.c
--- a/src/nxt_conf.c Thu Dec 26 17:04:37 2019 +0300
+++ b/src/nxt_conf.c Mon Dec 30 19:38:24 2019 +0800
@@ -814,6 +814,10 @@
default:
node = NULL;
+
+ if (parse.last) {
+ return NXT_CONF_OP_NOT_FOUND;
+ }
}
if (parse.last) {
BTW, how to run UNIT tests beside make tests
?