PHP :: Bug #68739 :: Missing break

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: None

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports