diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-05-22 16:32:42 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-05-22 16:32:42 +0200 |
commit | fda0e74c226b75a1379f43c46a0e0de4297eb9fc (patch) | |
tree | 80bf8d0ff6aa9314565d7591b77d3ab8a34eeaa7 /lib | |
parent | 03e2a9b023f60c2190c2b8590f16b2a4f83f21a9 (diff) |
RTSP: catch attempted unsupported requests better
Replace use of assert with code that properly catches bad input at
run-time even in non-debug builds.
This flaw was sort of detected by Coverity CID 1299425 which claimed the
"case RTSPREQ_NONE" was dead code.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rtsp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/rtsp.c b/lib/rtsp.c index b133e205f..c5ca75723 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -263,11 +263,10 @@ static CURLcode rtsp_do(struct connectdata *conn, bool *done) * Since all RTSP requests are included here, there is no need to * support custom requests like HTTP. **/ - DEBUGASSERT((rtspreq > RTSPREQ_NONE && rtspreq < RTSPREQ_LAST)); data->set.opt_no_body = TRUE; /* most requests don't contain a body */ switch(rtspreq) { - case RTSPREQ_NONE: - failf(data, "Got invalid RTSP request: RTSPREQ_NONE"); + default: + failf(data, "Got invalid RTSP request"); return CURLE_BAD_FUNCTION_ARGUMENT; case RTSPREQ_OPTIONS: p_request = "OPTIONS"; |