php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68739 Missing break / control flow
Submitted: 2015-01-04 10:08 UTC Modified: -
From: bugreports at internot dot info Assigned:
Status: Closed Package: cURL related
PHP Version: master-Git-2015-01-04 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID:
 [2015-01-04 10:08 UTC] bugreports at internot dot info
Description:
------------
Hi,

In /ext/curl/interface.c:


2716                case CURLOPT_SHARE:
2717                        {
2718                                php_curlsh *sh = NULL;
2719                                ZEND_FETCH_RESOURCE_NO_RETURN(sh, php_curlsh *, zvalue, -1, le_curl_share_handle_name, le_curl_share_handle);
2720                                if (sh) {
2721                                        curl_easy_setopt(ch->cp, CURLOPT_SHARE, sh->share);
2722                                }
2723                        }

This is missing a break;

Although it may look like it's just going to fall to the next one on purpose, I don't think it is, since..

2725#if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */
    
fallthrough: The above case falls through to this one.
2726                case CURLOPT_FNMATCH_FUNCTION:
2727                        curl_easy_setopt(ch->cp, CURLOPT_FNMATCH_FUNCTION, curl_fnmatch);
2728                        curl_easy_setopt(ch->cp, CURLOPT_FNMATCH_DATA, ch);
2729                        if (ch->handlers->fnmatch == NULL) {
2730                                ch->handlers->fnmatch = ecalloc(1, sizeof(php_curl_fnmatch));
2731                        } else if (!Z_ISUNDEF(ch->handlers->fnmatch->func_name)) {
2732                                zval_ptr_dtor(&ch->handlers->fnmatch->func_name);
2733                                ch->handlers->fnmatch->fci_cache = empty_fcall_info_cache;
2734                        }
2735                        ZVAL_COPY(&ch->handlers->fnmatch->func_name, zvalue);
2736                        ch->handlers->fnmatch->method = PHP_CURL_USER;
2737                        break;
2738#endif

If "LIBCURL_VERSION_NUM >= 0x071500" is false, then no break; will ever be used.



Thanks,


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-08 08:09 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=124fb22a13fafa3648e4e15b4f207c7096d8155e
Log: Fixed bug #68739 #68740 #68741
 [2015-01-08 08:09 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2015-03-31 22:47 UTC] kaplan@php.net
Automatic comment on behalf of kaplanlior@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a32c8ba719493fd2b4700c4f7db1ef130ceb7661
Log: Fixed bug #68739 (Missing break / control flow). Fixed bug #68740 (NULL Pointer Dereference). Fixed bug #68677 (Use After Free).
 [2015-03-31 22:47 UTC] kaplan@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1add8401a38de04f35b40d843e46186e9d318ea5
Log: Fixed bug #68739 (Missing break / control flow in curl)
 [2015-03-31 22:56 UTC] kaplan@php.net
Automatic comment on behalf of kaplanlior@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a32c8ba719493fd2b4700c4f7db1ef130ceb7661
Log: Fixed bug #68739 (Missing break / control flow). Fixed bug #68740 (NULL Pointer Dereference). Fixed bug #68677 (Use After Free).
 [2015-03-31 22:56 UTC] kaplan@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1add8401a38de04f35b40d843e46186e9d318ea5
Log: Fixed bug #68739 (Missing break / control flow in curl)
 [2015-03-31 23:02 UTC] kaplan@php.net
Automatic comment on behalf of kaplanlior@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a32c8ba719493fd2b4700c4f7db1ef130ceb7661
Log: Fixed bug #68739 (Missing break / control flow). Fixed bug #68740 (NULL Pointer Dereference). Fixed bug #68677 (Use After Free).
 [2015-03-31 23:02 UTC] kaplan@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1add8401a38de04f35b40d843e46186e9d318ea5
Log: Fixed bug #68739 (Missing break / control flow in curl)
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=124fb22a13fafa3648e4e15b4f207c7096d8155e
Log: Fixed bug #68739 #68740 #68741
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sat Jul 22 20:01:35 2017 UTC