]> granicus.if.org Git - curl/commitdiff
multi: fix off-by-one finit[] array size
authorDaniel Stenberg <daniel@haxx.se>
Fri, 16 Oct 2015 20:42:30 +0000 (22:42 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 16 Oct 2015 20:42:56 +0000 (22:42 +0200)
introduced in c6aedf680f6. It needs to be CURLM_STATE_LAST big since it
must hande the range 0 .. CURLM_STATE_MSGSENT (18) and CURLM_STATE_LAST
is 19 right now.

Reported-by: Dan Fandrich
Bug: http://curl.haxx.se/mail/lib-2015-10/0069.html

lib/multi.c

index 12e84b9e5c08a14d0dcbe3496b871ebc6f7a3304..14152be20814e61631cc3cdba14f5cfa0c8a1e39 100644 (file)
@@ -110,7 +110,7 @@ static void mstate(struct SessionHandle *data, CURLMstate state
 )
 {
   CURLMstate oldstate = data->mstate;
-  static const init_multistate_func finit[CURLM_STATE_LAST-1] = {
+  static const init_multistate_func finit[CURLM_STATE_LAST] = {
     NULL,
     NULL,
     Curl_init_CONNECT, /* CONNECT */