hash
int64 -9,197,960,073,880,366,000
9,199,363,627B
| project
stringclasses 2
values | size
int64 2
5.68k
| label
int64 0
1
| functionSource
stringlengths 31
235k
|
---|---|---|---|---|
-7,855,974,557,509,681,000 | debian | 12 | 0 | Oid get_commutator ( Oid opno ) {
HeapTuple tp ;
tp = SearchSysCache1 ( OPEROID , ObjectIdGetDatum ( opno ) ) ;
if ( HeapTupleIsValid ( tp ) ) {
Form_pg_operator optup = ( Form_pg_operator ) GETSTRUCT ( tp ) ;
Oid result ;
result = optup -> oprcom ;
ReleaseSysCache ( tp ) ;
return result ;
}
else return InvalidOid ;
} |
-1,338,403,456,839,869,200 | debian | 73 | 0 | static void dissect_q931_cause_ie_with_info ( tvbuff_t * tvb , int offset , int len , proto_tree * tree , int hf_cause_value , guint8 * cause_value , const value_string * ie_vals , q931_packet_info * q931_pi ) {
guint8 octet ;
guint8 coding_standard ;
guint8 rejection_reason ;
if ( len == 0 ) return ;
octet = tvb_get_guint8 ( tvb , offset ) ;
coding_standard = octet & 0x60 ;
if ( coding_standard != Q931_ITU_STANDARDIZED_CODING && ! g931_iso_iec_cause && coding_standard != Q931_ISO_IEC_STANDARDIZED_CODING ) {
proto_tree_add_uint ( tree , hf_q931_coding_standard , tvb , offset , 1 , octet ) ;
proto_tree_add_item ( tree , hf_q931_cause_data , tvb , offset , len , ENC_NA ) ;
return ;
}
proto_tree_add_uint ( tree , hf_q931_cause_location , tvb , offset , 1 , octet ) ;
proto_tree_add_uint ( tree , hf_q931_coding_standard , tvb , offset , 1 , octet ) ;
proto_tree_add_boolean ( tree , hf_q931_extension_ind , tvb , offset , 1 , octet ) ;
offset += 1 ;
len -= 1 ;
if ( ! ( octet & Q931_IE_VL_EXTENSION ) ) {
if ( len == 0 ) return ;
octet = tvb_get_guint8 ( tvb , offset ) ;
proto_tree_add_item ( tree , hf_q931_cause_recommendation , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_boolean ( tree , hf_q931_extension_ind , tvb , offset , 1 , octet ) ;
offset += 1 ;
len -= 1 ;
}
if ( len == 0 ) return ;
octet = tvb_get_guint8 ( tvb , offset ) ;
* cause_value = octet & 0x7F ;
if ( q931_pi ) {
q931_pi -> cause_value = * cause_value ;
}
proto_tree_add_uint ( tree , hf_cause_value , tvb , offset , 1 , * cause_value ) ;
proto_tree_add_boolean ( tree , hf_q931_extension_ind , tvb , offset , 1 , octet ) ;
offset += 1 ;
len -= 1 ;
if ( len == 0 ) return ;
switch ( * cause_value ) {
case Q931_CAUSE_UNALLOC_NUMBER : case Q931_CAUSE_NO_ROUTE_TO_DEST : case Q931_CAUSE_QOS_UNAVAILABLE : proto_tree_add_item ( tree , hf_q931_network_service , tvb , offset , 1 , ENC_NA ) ;
proto_tree_add_item ( tree , hf_q931_extension_condition_type , tvb , offset , 1 , ENC_NA ) ;
proto_tree_add_item ( tree , hf_q931_extension_condition , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
case Q931_CAUSE_CALL_REJECTED : rejection_reason = octet & 0x7C ;
proto_tree_add_item ( tree , hf_q931_cause_call_rejection_reason , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_q931_cause_call_condition , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset += 1 ;
len -= 1 ;
if ( len == 0 ) return ;
switch ( rejection_reason ) {
case Q931_REJ_USER_SPECIFIC : proto_tree_add_item ( tree , hf_q931_cause_call_user_specific_diagnostic , tvb , offset , len , ENC_NA ) ;
break ;
case Q931_REJ_IE_MISSING : proto_tree_add_uint_format_value ( tree , hf_q931_missing_info_element , tvb , offset , 1 , tvb_get_guint8 ( tvb , offset ) , "%s" , val_to_str ( tvb_get_guint8 ( tvb , offset ) , ie_vals , "Unknown (0x%02X)" ) ) ;
break ;
case Q931_REJ_IE_INSUFFICIENT : proto_tree_add_uint_format_value ( tree , hf_q931_insufficient_info_element , tvb , offset , 1 , tvb_get_guint8 ( tvb , offset ) , "%s" , val_to_str ( tvb_get_guint8 ( tvb , offset ) , ie_vals , "Unknown (0x%02X)" ) ) ;
break ;
default : proto_tree_add_item ( tree , hf_q931_cause_call_diagnostic , tvb , offset , len , ENC_NA ) ;
break ;
}
break ;
case Q931_CAUSE_ACCESS_INFO_DISC : case Q931_CAUSE_INCOMPATIBLE_DEST : case Q931_CAUSE_MAND_IE_MISSING : case Q931_CAUSE_IE_NONEX_OR_UNIMPL : case Q931_CAUSE_INVALID_IE_CONTENTS : do {
proto_tree_add_uint_format_value ( tree , hf_q931_information_element , tvb , offset , 1 , tvb_get_guint8 ( tvb , offset ) , "%s" , val_to_str ( tvb_get_guint8 ( tvb , offset ) , ie_vals , "Unknown (0x%02X)" ) ) ;
offset += 1 ;
len -= 1 ;
}
while ( len != 0 ) ;
break ;
case Q931_CAUSE_MT_NONEX_OR_UNIMPL : case Q931_CAUSE_MSG_INCOMPAT_W_CS : proto_tree_add_item ( tree , hf_q931_cause_call_message_type , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
case Q931_CAUSE_REC_TIMER_EXP : if ( len < 3 ) return ;
proto_tree_add_item ( tree , hf_q931_cause_call_rec_timer , tvb , offset , 3 , ENC_NA | ENC_ASCII ) ;
break ;
default : proto_tree_add_item ( tree , hf_q931_cause_call_diagnostic , tvb , offset , len , ENC_NA ) ;
}
} |
-4,271,192,073,087,307,000 | debian | 7 | 0 | static inline int get_ue_code ( GetBitContext * gb , int order ) {
if ( order ) {
int ret = get_ue_golomb ( gb ) << order ;
return ret + get_bits ( gb , order ) ;
}
return get_ue_golomb ( gb ) ;
} |
3,584,320,764,213,684,000 | debian | 14 | 0 | static int parse_CRowSeekNext ( tvbuff_t * tvb , int offset , proto_tree * parent_tree , const char * fmt , ... ) {
proto_tree * tree ;
proto_item * item ;
const char * txt ;
va_list ap ;
va_start ( ap , fmt ) ;
txt = wmem_strdup_vprintf ( wmem_packet_scope ( ) , fmt , ap ) ;
va_end ( ap ) ;
tree = proto_tree_add_subtree ( parent_tree , tvb , offset , 0 , ett_CRowsSeekNext , & item , txt ) ;
proto_tree_add_item ( tree , hf_mswsp_crowseeknext_cskip , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_item_set_end ( item , tvb , offset ) ;
return offset ;
} |
3,804,373,597,256,531,000 | debian | 28 | 0 | void fill_effective_table_privileges ( THD * thd , GRANT_INFO * grant , const char * db , const char * table ) {
Security_context * sctx = thd -> security_ctx ;
DBUG_ENTER ( "fill_effective_table_privileges" ) ;
DBUG_PRINT ( "enter" , ( "Host: '%s', Ip: '%s', User: '%s', table: `%s`.`%s`" , sctx -> priv_host , ( sctx -> ip ? sctx -> ip : "(NULL)" ) , ( sctx -> priv_user ? sctx -> priv_user : "(NULL)" ) , db , table ) ) ;
if ( ! initialized ) {
DBUG_PRINT ( "info" , ( "skip grants" ) ) ;
grant -> privilege = ~ NO_ACCESS ;
DBUG_PRINT ( "info" , ( "privilege 0x%lx" , grant -> privilege ) ) ;
DBUG_VOID_RETURN ;
}
grant -> privilege = sctx -> master_access ;
if ( ! sctx -> priv_user ) {
DBUG_PRINT ( "info" , ( "privilege 0x%lx" , grant -> privilege ) ) ;
DBUG_VOID_RETURN ;
}
grant -> privilege |= acl_get ( sctx -> host , sctx -> ip , sctx -> priv_user , db , 0 ) ;
rw_rdlock ( & LOCK_grant ) ;
if ( grant -> version != grant_version ) {
grant -> grant_table = table_hash_search ( sctx -> host , sctx -> ip , db , sctx -> priv_user , table , 0 ) ;
grant -> version = grant_version ;
}
if ( grant -> grant_table != 0 ) {
grant -> privilege |= grant -> grant_table -> privs ;
}
rw_unlock ( & LOCK_grant ) ;
DBUG_PRINT ( "info" , ( "privilege 0x%lx" , grant -> privilege ) ) ;
DBUG_VOID_RETURN ;
} |
-5,697,857,125,570,094,000 | chrome | 3 | 0 | static const char * ultag_getRegion ( const ULanguageTag * langtag ) {
return langtag -> region ;
} |
313,627,013,719,508,800 | debian | 3 | 0 | static inline Quantum GetPixelMagenta ( const Image * restrict image , const Quantum * restrict pixel ) {
return ( pixel [ image -> channel_map [ MagentaPixelChannel ] . offset ] ) ;
} |
1,830,000,892,320,875,500 | debian | 73 | 0 | static void cmd_network_add_modify ( const char * data , gboolean add ) {
GHashTable * optlist ;
char * name , * value ;
void * free_arg ;
IRC_CHATNET_REC * rec ;
if ( ! cmd_get_params ( data , & free_arg , 1 | PARAM_FLAG_OPTIONS , "network add" , & optlist , & name ) ) return ;
if ( * name == '\0' ) cmd_param_error ( CMDERR_NOT_ENOUGH_PARAMS ) ;
rec = ircnet_find ( name ) ;
if ( rec == NULL ) {
if ( add == FALSE ) {
printformat ( NULL , NULL , MSGLEVEL_CLIENTNOTICE , IRCTXT_NETWORK_NOT_FOUND , name ) ;
cmd_params_free ( free_arg ) ;
return ;
}
rec = g_new0 ( IRC_CHATNET_REC , 1 ) ;
rec -> name = g_strdup ( name ) ;
}
else {
if ( g_hash_table_lookup ( optlist , "nick" ) ) g_free_and_null ( rec -> nick ) ;
if ( g_hash_table_lookup ( optlist , "alternate_nick" ) ) g_free_and_null ( rec -> alternate_nick ) ;
if ( g_hash_table_lookup ( optlist , "user" ) ) g_free_and_null ( rec -> username ) ;
if ( g_hash_table_lookup ( optlist , "realname" ) ) g_free_and_null ( rec -> realname ) ;
if ( g_hash_table_lookup ( optlist , "host" ) ) {
g_free_and_null ( rec -> own_host ) ;
rec -> own_ip4 = rec -> own_ip6 = NULL ;
}
if ( g_hash_table_lookup ( optlist , "usermode" ) ) g_free_and_null ( rec -> usermode ) ;
if ( g_hash_table_lookup ( optlist , "autosendcmd" ) ) g_free_and_null ( rec -> autosendcmd ) ;
if ( g_hash_table_lookup ( optlist , "sasl_mechanism" ) ) g_free_and_null ( rec -> sasl_mechanism ) ;
if ( g_hash_table_lookup ( optlist , "sasl_username" ) ) g_free_and_null ( rec -> sasl_username ) ;
if ( g_hash_table_lookup ( optlist , "sasl_password" ) ) g_free_and_null ( rec -> sasl_password ) ;
}
value = g_hash_table_lookup ( optlist , "kicks" ) ;
if ( value != NULL ) rec -> max_kicks = atoi ( value ) ;
value = g_hash_table_lookup ( optlist , "msgs" ) ;
if ( value != NULL ) rec -> max_msgs = atoi ( value ) ;
value = g_hash_table_lookup ( optlist , "modes" ) ;
if ( value != NULL ) rec -> max_modes = atoi ( value ) ;
value = g_hash_table_lookup ( optlist , "whois" ) ;
if ( value != NULL ) rec -> max_whois = atoi ( value ) ;
value = g_hash_table_lookup ( optlist , "cmdspeed" ) ;
if ( value != NULL ) rec -> cmd_queue_speed = atoi ( value ) ;
value = g_hash_table_lookup ( optlist , "cmdmax" ) ;
if ( value != NULL ) rec -> max_cmds_at_once = atoi ( value ) ;
value = g_hash_table_lookup ( optlist , "querychans" ) ;
if ( value != NULL ) rec -> max_query_chans = atoi ( value ) ;
value = g_hash_table_lookup ( optlist , "nick" ) ;
if ( value != NULL && * value != '\0' ) rec -> nick = g_strdup ( value ) ;
value = g_hash_table_lookup ( optlist , "alternate_nick" ) ;
if ( value != NULL && * value != '\0' ) rec -> alternate_nick = g_strdup ( value ) ;
value = g_hash_table_lookup ( optlist , "user" ) ;
if ( value != NULL && * value != '\0' ) rec -> username = g_strdup ( value ) ;
value = g_hash_table_lookup ( optlist , "realname" ) ;
if ( value != NULL && * value != '\0' ) rec -> realname = g_strdup ( value ) ;
value = g_hash_table_lookup ( optlist , "host" ) ;
if ( value != NULL && * value != '\0' ) {
rec -> own_host = g_strdup ( value ) ;
rec -> own_ip4 = rec -> own_ip6 = NULL ;
}
value = g_hash_table_lookup ( optlist , "usermode" ) ;
if ( value != NULL && * value != '\0' ) rec -> usermode = g_strdup ( value ) ;
value = g_hash_table_lookup ( optlist , "autosendcmd" ) ;
if ( value != NULL && * value != '\0' ) rec -> autosendcmd = g_strdup ( value ) ;
value = g_hash_table_lookup ( optlist , "sasl_mechanism" ) ;
if ( value != NULL ) rec -> sasl_mechanism = * value != '\0' ? g_strdup ( value ) : NULL ;
value = g_hash_table_lookup ( optlist , "sasl_username" ) ;
if ( value != NULL ) rec -> sasl_username = * value != '\0' ? g_strdup ( value ) : NULL ;
value = g_hash_table_lookup ( optlist , "sasl_password" ) ;
if ( value != NULL ) rec -> sasl_password = * value != '\0' ? g_strdup ( value ) : NULL ;
ircnet_create ( rec ) ;
printformat ( NULL , NULL , MSGLEVEL_CLIENTNOTICE , IRCTXT_NETWORK_ADDED , name ) ;
cmd_params_free ( free_arg ) ;
} |
-1,338,403,456,839,869,200 | debian | 8 | 0 | static void dissect_q931_pl_window_size_ie ( tvbuff_t * tvb , int offset , int len , proto_tree * tree ) {
if ( len == 0 ) return ;
proto_tree_add_item ( tree , hf_q931_pl_window_size_forward_value , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset += 1 ;
len -= 1 ;
if ( len == 0 ) return ;
proto_tree_add_item ( tree , hf_q931_pl_window_size_backward_value , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
} |
7,399,683,071,036,019,000 | debian | 10 | 0 | static void pdo_stmt_iter_dtor ( zend_object_iterator * iter TSRMLS_DC ) {
struct php_pdo_iterator * I = ( struct php_pdo_iterator * ) iter -> data ;
if ( -- I -> stmt -> refcount == 0 ) {
free_statement ( I -> stmt TSRMLS_CC ) ;
}
if ( I -> fetch_ahead ) {
zval_ptr_dtor ( & I -> fetch_ahead ) ;
}
efree ( I ) ;
} |
8,184,523,117,871,479,000 | chrome | 19 | 0 | TEST ( URLFixerTest , SegmentURL ) {
std : : string result ;
url : : Parsed parts ;
for ( size_t i = 0 ;
i < arraysize ( segment_cases ) ;
++ i ) {
SegmentCase value = segment_cases [ i ] ;
result = url_formatter : : SegmentURL ( value . input , & parts ) ;
EXPECT_EQ ( value . result , result ) ;
EXPECT_EQ ( value . scheme , parts . scheme ) ;
EXPECT_EQ ( value . username , parts . username ) ;
EXPECT_EQ ( value . password , parts . password ) ;
EXPECT_EQ ( value . host , parts . host ) ;
EXPECT_EQ ( value . port , parts . port ) ;
EXPECT_EQ ( value . path , parts . path ) ;
EXPECT_EQ ( value . query , parts . query ) ;
EXPECT_EQ ( value . ref , parts . ref ) ;
}
} |
-4,719,501,675,862,911,000 | debian | 3 | 0 | void h245_set_h223_add_lc_handle ( h223_add_lc_handle_t handle ) {
h223_add_lc_handle = handle ;
} |
-1,102,844,685,921,778,700 | debian | 3 | 0 | static int utf16le_to_unicode ( uint32_t * pwc , const char * s , size_t n ) {
return ( utf16_to_unicode ( pwc , s , n , 0 ) ) ;
} |
-2,515,786,237,983,240,000 | debian | 13 | 0 | static void skip ( struct vars * v ) {
const chr * start = v -> now ;
assert ( v -> cflags & REG_EXPANDED ) ;
for ( ;
;
) {
while ( ! ATEOS ( ) && iscspace ( * v -> now ) ) v -> now ++ ;
if ( ATEOS ( ) || * v -> now != CHR ( '#' ) ) break ;
assert ( NEXT1 ( '#' ) ) ;
while ( ! ATEOS ( ) && * v -> now != CHR ( '\n' ) ) v -> now ++ ;
}
if ( v -> now != start ) NOTE ( REG_UNONPOSIX ) ;
} |
-4,239,386,405,881,995,300 | chrome | 3 | 0 | void * xmlHashQLookup2 ( xmlHashTablePtr table , const xmlChar * prefix , const xmlChar * name , const xmlChar * prefix2 , const xmlChar * name2 ) {
return ( xmlHashQLookup3 ( table , prefix , name , prefix2 , name2 , NULL , NULL ) ) ;
} |
-5,689,214,734,378,700,000 | debian | 61 | 0 | static PyObject * _cbson_bson_to_dict ( PyObject * self , PyObject * args ) {
unsigned int size ;
Py_ssize_t total_size ;
const char * string ;
PyObject * bson ;
PyObject * as_class ;
unsigned char tz_aware ;
unsigned char uuid_subtype ;
PyObject * dict ;
PyObject * remainder ;
PyObject * result ;
if ( ! PyArg_ParseTuple ( args , "OObb" , & bson , & as_class , & tz_aware , & uuid_subtype ) ) {
return NULL ;
}
# if PY_MAJOR_VERSION >= 3 if ( ! PyBytes_Check ( bson ) ) {
PyErr_SetString ( PyExc_TypeError , "argument to _bson_to_dict must be a bytes object" ) ;
# else if ( ! PyString_Check ( bson ) ) {
PyErr_SetString ( PyExc_TypeError , "argument to _bson_to_dict must be a string" ) ;
# endif return NULL ;
}
# if PY_MAJOR_VERSION >= 3 total_size = PyBytes_Size ( bson ) ;
# else total_size = PyString_Size ( bson ) ;
# endif if ( total_size < 5 ) {
PyObject * InvalidBSON = _error ( "InvalidBSON" ) ;
PyErr_SetString ( InvalidBSON , "not enough data for a BSON document" ) ;
Py_DECREF ( InvalidBSON ) ;
return NULL ;
}
# if PY_MAJOR_VERSION >= 3 string = PyBytes_AsString ( bson ) ;
# else string = PyString_AsString ( bson ) ;
# endif if ( ! string ) {
return NULL ;
}
memcpy ( & size , string , 4 ) ;
if ( total_size < size ) {
PyObject * InvalidBSON = _error ( "InvalidBSON" ) ;
PyErr_SetString ( InvalidBSON , "objsize too large" ) ;
Py_DECREF ( InvalidBSON ) ;
return NULL ;
}
if ( size != total_size || string [ size - 1 ] ) {
PyObject * InvalidBSON = _error ( "InvalidBSON" ) ;
PyErr_SetString ( InvalidBSON , "bad eoo" ) ;
Py_DECREF ( InvalidBSON ) ;
return NULL ;
}
dict = elements_to_dict ( self , string + 4 , size - 5 , as_class , tz_aware , uuid_subtype ) ;
if ( ! dict ) {
return NULL ;
}
# if PY_MAJOR_VERSION >= 3 remainder = PyBytes_FromStringAndSize ( string + size , total_size - size ) ;
# else remainder = PyString_FromStringAndSize ( string + size , total_size - size ) ;
# endif if ( ! remainder ) {
Py_DECREF ( dict ) ;
return NULL ;
}
result = Py_BuildValue ( "OO" , dict , remainder ) ;
Py_DECREF ( dict ) ;
Py_DECREF ( remainder ) ;
return result ;
} |
416,708,768,813,973,440 | chrome | 4 | 0 | TEST_F ( TemplateURLParserTest , FailOnBogusURL ) {
ASSERT_NO_FATAL_FAILURE ( ParseFile ( "bogus.xml" , nullptr ) ) ;
EXPECT_FALSE ( template_url_ ) ;
} |
8,572,106,347,813,672,000 | debian | 29 | 0 | static void dump_ah_combs ( struct sk_buff * skb , const struct xfrm_tmpl * t ) {
struct sadb_prop * p ;
int i ;
p = ( struct sadb_prop * ) skb_put ( skb , sizeof ( struct sadb_prop ) ) ;
p -> sadb_prop_len = sizeof ( struct sadb_prop ) / 8 ;
p -> sadb_prop_exttype = SADB_EXT_PROPOSAL ;
p -> sadb_prop_replay = 32 ;
memset ( p -> sadb_prop_reserved , 0 , sizeof ( p -> sadb_prop_reserved ) ) ;
for ( i = 0 ;
;
i ++ ) {
const struct xfrm_algo_desc * aalg = xfrm_aalg_get_byidx ( i ) ;
if ( ! aalg ) break ;
if ( ! aalg -> pfkey_supported ) continue ;
if ( aalg_tmpl_set ( t , aalg ) && aalg -> available ) {
struct sadb_comb * c ;
c = ( struct sadb_comb * ) skb_put ( skb , sizeof ( struct sadb_comb ) ) ;
memset ( c , 0 , sizeof ( * c ) ) ;
p -> sadb_prop_len += sizeof ( struct sadb_comb ) / 8 ;
c -> sadb_comb_auth = aalg -> desc . sadb_alg_id ;
c -> sadb_comb_auth_minbits = aalg -> desc . sadb_alg_minbits ;
c -> sadb_comb_auth_maxbits = aalg -> desc . sadb_alg_maxbits ;
c -> sadb_comb_hard_addtime = 24 * 60 * 60 ;
c -> sadb_comb_soft_addtime = 20 * 60 * 60 ;
c -> sadb_comb_hard_usetime = 8 * 60 * 60 ;
c -> sadb_comb_soft_usetime = 7 * 60 * 60 ;
}
}
} |
1,223,258,652,239,369,200 | debian | 13 | 0 | SPL_METHOD ( FilesystemIterator , key ) {
spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ;
if ( zend_parse_parameters_none ( ) == FAILURE ) {
return ;
}
if ( SPL_FILE_DIR_KEY ( intern , SPL_FILE_DIR_KEY_AS_FILENAME ) ) {
RETURN_STRING ( intern -> u . dir . entry . d_name , 1 ) ;
}
else {
spl_filesystem_object_get_file_name ( intern TSRMLS_CC ) ;
RETURN_STRINGL ( intern -> file_name , intern -> file_name_len , 1 ) ;
}
} |
-770,464,550,770,502,000 | chrome | 11 | 1 | IN_PROC_BROWSER_TEST_F ( ExternalProtocolDialogBrowserTest , TestCancelWithChecked ) {
ShowDialog ( ) ;
SetChecked ( true ) ;
EXPECT_TRUE ( dialog_ -> Cancel ( ) ) ;
EXPECT_TRUE ( called_ ) ;
EXPECT_FALSE ( accept_ ) ;
EXPECT_TRUE ( cancel_ ) ;
EXPECT_TRUE ( dont_block_ ) ;
histogram_tester_ . ExpectBucketCount ( ExternalProtocolHandler : : kRememberCheckboxMetric , 1 , 1 ) ;
histogram_tester_ . ExpectBucketCount ( ExternalProtocolHandler : : kHandleStateMetric , ExternalProtocolHandler : : CHECKED_DONT_LAUNCH , 1 ) ;
} |
7,823,043,019,110,227,000 | chrome | 6 | 0 | TEST_F ( ExternalProtocolHandlerTest , TestGetBlockStateUnknown ) {
ExternalProtocolHandler : : BlockState block_state = ExternalProtocolHandler : : GetBlockState ( "tel" , profile_ . get ( ) ) ;
EXPECT_EQ ( ExternalProtocolHandler : : UNKNOWN , block_state ) ;
EXPECT_TRUE ( local_state_ -> GetDictionary ( prefs : : kExcludedSchemes ) -> empty ( ) ) ;
EXPECT_TRUE ( profile_ -> GetPrefs ( ) -> GetDictionary ( prefs : : kExcludedSchemes ) -> empty ( ) ) ;
} |
6,829,083,446,989,852,000 | chrome | 12 | 0 | void vp9_free_internal_frame_buffers ( InternalFrameBufferList * list ) {
int i ;
assert ( list != NULL ) ;
for ( i = 0 ;
i < list -> num_internal_frame_buffers ;
++ i ) {
vpx_free ( list -> int_fb [ i ] . data ) ;
list -> int_fb [ i ] . data = NULL ;
}
vpx_free ( list -> int_fb ) ;
list -> int_fb = NULL ;
} |
-3,725,939,782,329,394,000 | debian | 5 | 0 | static void _tiffDummyUnmapProc ( thandle_t fd , void * base , toff_t size ) {
( void ) fd ;
( void ) base ;
( void ) size ;
} |
4,876,100,961,671,883,000 | debian | 12 | 0 | static int dissect_pvfs_credentials ( tvbuff_t * tvb , proto_tree * parent_tree , int offset ) {
proto_tree * hcred_tree ;
guint32 uid , gid ;
uid = tvb_get_letohl ( tvb , offset ) ;
gid = tvb_get_letohl ( tvb , offset + 4 ) ;
hcred_tree = proto_tree_add_subtree_format ( parent_tree , tvb , offset , 8 , ett_pvfs_credentials , NULL , "Credentials (UID: %d, GID: %d)" , uid , gid ) ;
proto_tree_add_item ( hcred_tree , hf_pvfs_uid , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( hcred_tree , hf_pvfs_gid , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
return offset ;
} |
3,804,373,597,256,531,000 | debian | 49 | 0 | int fill_schema_table_privileges ( THD * thd , TABLE_LIST * tables , COND * cond ) {
# ifndef NO_EMBEDDED_ACCESS_CHECKS int error = 0 ;
uint index ;
char buff [ 100 ] ;
TABLE * table = tables -> table ;
bool no_global_access = check_access ( thd , SELECT_ACL , "mysql" , 0 , 1 , 1 , 0 ) ;
char * curr_host = thd -> security_ctx -> priv_host_name ( ) ;
DBUG_ENTER ( "fill_schema_table_privileges" ) ;
rw_rdlock ( & LOCK_grant ) ;
for ( index = 0 ;
index < column_priv_hash . records ;
index ++ ) {
const char * user , * host , * is_grantable = "YES" ;
GRANT_TABLE * grant_table = ( GRANT_TABLE * ) hash_element ( & column_priv_hash , index ) ;
if ( ! ( user = grant_table -> user ) ) user = "" ;
if ( ! ( host = grant_table -> host . hostname ) ) host = "" ;
if ( no_global_access && ( strcmp ( thd -> security_ctx -> priv_user , user ) || my_strcasecmp ( system_charset_info , curr_host , host ) ) ) continue ;
ulong table_access = grant_table -> privs ;
if ( table_access ) {
ulong test_access = table_access & ~ GRANT_ACL ;
if ( ! test_access && grant_table -> cols ) continue ;
if ( ! ( table_access & GRANT_ACL ) ) is_grantable = "NO" ;
strxmov ( buff , "'" , user , "'@'" , host , "'" , NullS ) ;
if ( ! test_access ) {
if ( update_schema_privilege ( thd , table , buff , grant_table -> db , grant_table -> tname , 0 , 0 , STRING_WITH_LEN ( "USAGE" ) , is_grantable ) ) {
error = 1 ;
goto err ;
}
}
else {
ulong j ;
int cnt ;
for ( cnt = 0 , j = SELECT_ACL ;
j <= TABLE_ACLS ;
cnt ++ , j <<= 1 ) {
if ( test_access & j ) {
if ( update_schema_privilege ( thd , table , buff , grant_table -> db , grant_table -> tname , 0 , 0 , command_array [ cnt ] , command_lengths [ cnt ] , is_grantable ) ) {
error = 1 ;
goto err ;
}
}
}
}
}
}
err : rw_unlock ( & LOCK_grant ) ;
DBUG_RETURN ( error ) ;
# else return ( 0 ) ;
# endif } |
-8,925,552,398,357,902,000 | chrome | 9 | 0 | static void set_entropy_context_b ( int plane , int block , BLOCK_SIZE plane_bsize , TX_SIZE tx_size , void * arg ) {
struct tokenize_b_args * const args = arg ;
MACROBLOCKD * const xd = args -> xd ;
struct macroblock_plane * p = & args -> cpi -> mb . plane [ plane ] ;
struct macroblockd_plane * pd = & xd -> plane [ plane ] ;
int aoff , loff ;
txfrm_block_to_raster_xy ( plane_bsize , tx_size , block , & aoff , & loff ) ;
vp9_set_contexts ( xd , pd , plane_bsize , tx_size , p -> eobs [ block ] > 0 , aoff , loff ) ;
} |
-4,885,528,830,177,757,000 | debian | 44 | 0 | static int sort_ft_key_write ( MI_SORT_PARAM * sort_param , const void * a ) {
uint a_len , val_off , val_len , error ;
uchar * p ;
SORT_INFO * sort_info = sort_param -> sort_info ;
SORT_FT_BUF * ft_buf = sort_info -> ft_buf ;
SORT_KEY_BLOCKS * key_block = sort_info -> key_block ;
val_len = HA_FT_WLEN + sort_info -> info -> s -> rec_reflength ;
get_key_full_length_rdonly ( a_len , ( uchar * ) a ) ;
if ( ! ft_buf ) {
if ( ( sort_info -> info -> s -> base . key_reflength <= sort_info -> info -> s -> rec_reflength ) && ( sort_info -> info -> s -> options & ( HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD ) ) ) ft_buf = ( SORT_FT_BUF * ) my_malloc ( sort_param -> keyinfo -> block_length + sizeof ( SORT_FT_BUF ) , MYF ( MY_WME ) ) ;
if ( ! ft_buf ) {
sort_param -> key_write = sort_key_write ;
return sort_key_write ( sort_param , a ) ;
}
sort_info -> ft_buf = ft_buf ;
goto word_init_ft_buf ;
}
get_key_full_length_rdonly ( val_off , ft_buf -> lastkey ) ;
if ( ha_compare_text ( sort_param -> seg -> charset , ( ( uchar * ) a ) + 1 , a_len - 1 , ft_buf -> lastkey + 1 , val_off - 1 , 0 , 0 ) == 0 ) {
if ( ! ft_buf -> buf ) {
ft_buf -> count ++ ;
return sort_insert_key ( sort_param , key_block , ( ( uchar * ) a ) + a_len , HA_OFFSET_ERROR ) ;
}
memcpy ( ft_buf -> buf , ( char * ) a + a_len , val_len ) ;
ft_buf -> buf += val_len ;
if ( ft_buf -> buf < ft_buf -> end ) return 0 ;
p = ft_buf -> lastkey + val_off ;
while ( key_block -> inited ) key_block ++ ;
sort_info -> key_block = key_block ;
sort_param -> keyinfo = & sort_info -> info -> s -> ft2_keyinfo ;
ft_buf -> count = ( uint ) ( ft_buf -> buf - p ) / val_len ;
for ( error = 0 ;
! error && p < ft_buf -> buf ;
p += val_len ) error = sort_insert_key ( sort_param , key_block , p , HA_OFFSET_ERROR ) ;
ft_buf -> buf = 0 ;
return error ;
}
if ( ( error = sort_ft_buf_flush ( sort_param ) ) ) return error ;
word_init_ft_buf : a_len += val_len ;
memcpy ( ft_buf -> lastkey , a , a_len ) ;
ft_buf -> buf = ft_buf -> lastkey + a_len ;
ft_buf -> end = ft_buf -> lastkey + ( sort_param -> keyinfo -> block_length - 32 ) ;
return 0 ;
} |
1,182,028,467,273,265,000 | debian | 71 | 0 | void do_exec ( struct st_command * command ) {
int error ;
char buf [ 512 ] ;
FILE * res_file ;
char * cmd = command -> first_argument ;
DYNAMIC_STRING ds_cmd ;
DYNAMIC_STRING ds_sorted , * ds_result ;
DBUG_ENTER ( "do_exec" ) ;
DBUG_PRINT ( "enter" , ( "cmd: '%s'" , cmd ) ) ;
while ( * cmd && my_isspace ( charset_info , * cmd ) ) cmd ++ ;
if ( ! * cmd ) {
report_or_die ( "Missing argument in exec" ) ;
return ;
}
command -> last_argument = command -> end ;
init_dynamic_string ( & ds_cmd , 0 , command -> query_len + 256 , 256 ) ;
do_eval ( & ds_cmd , cmd , command -> end , ! is_windows ) ;
if ( builtin_echo [ 0 ] && strncmp ( cmd , "echo" , 4 ) == 0 ) {
replace ( & ds_cmd , "echo" , 4 , builtin_echo , strlen ( builtin_echo ) ) ;
}
# ifdef __WIN__ # ifndef USE_CYGWIN while ( replace ( & ds_cmd , "/devull" , 9 , "NUL" , 3 ) == 0 ) ;
while ( replace ( & ds_cmd , ">&-" , 3 , ">&4" , 3 ) == 0 ) ;
# endif # endif DBUG_PRINT ( "info" , ( "Executing '%s' as '%s'" , command -> first_argument , ds_cmd . str ) ) ;
if ( ! ( res_file = my_popen ( & ds_cmd , "r" ) ) ) {
dynstr_free ( & ds_cmd ) ;
if ( command -> abort_on_error ) report_or_die ( "popen(\"%s\", \"r\") failed" , command -> first_argument ) ;
return ;
}
ds_result = & ds_res ;
if ( display_result_sorted ) {
init_dynamic_string ( & ds_sorted , "" , 1024 , 1024 ) ;
ds_result = & ds_sorted ;
}
while ( fgets ( buf , sizeof ( buf ) , res_file ) ) {
if ( disable_result_log ) {
buf [ strlen ( buf ) - 1 ] = 0 ;
DBUG_PRINT ( "exec_result" , ( "%s" , buf ) ) ;
}
else {
replace_dynstr_append ( ds_result , buf ) ;
}
}
error = pclose ( res_file ) ;
if ( display_result_sorted ) {
dynstr_append_sorted ( & ds_res , & ds_sorted , 0 ) ;
dynstr_free ( & ds_sorted ) ;
}
if ( error > 0 ) {
uint status = WEXITSTATUS ( error ) ;
int i ;
if ( command -> abort_on_error ) {
report_or_die ( "exec of '%s' failed, error: %d, status: %d, errno: %d\n" "Output from before failure:\n%s\n" , ds_cmd . str , error , status , errno , ds_res . str ) ;
dynstr_free ( & ds_cmd ) ;
return ;
}
DBUG_PRINT ( "info" , ( "error: %d, status: %d" , error , status ) ) ;
i = match_expected_error ( command , status , NULL ) ;
if ( i >= 0 ) DBUG_PRINT ( "info" , ( "command \"%s\" failed with expected error: %d" , command -> first_argument , status ) ) ;
else {
dynstr_free ( & ds_cmd ) ;
if ( command -> expected_errors . count > 0 ) report_or_die ( "command \"%s\" failed with wrong error: %d" , command -> first_argument , status ) ;
}
}
else if ( command -> expected_errors . err [ 0 ] . type == ERR_ERRNO && command -> expected_errors . err [ 0 ] . code . errnum != 0 ) {
log_msg ( "exec of '%s failed, error: %d, errno: %d" , ds_cmd . str , error , errno ) ;
dynstr_free ( & ds_cmd ) ;
report_or_die ( "command \"%s\" succeeded - should have failed with " "errno %d..." , command -> first_argument , command -> expected_errors . err [ 0 ] . code . errnum ) ;
}
dynstr_free ( & ds_cmd ) ;
DBUG_VOID_RETURN ;
} |
1,245,821,301,839,614,700 | debian | 5 | 0 | static char * custom_size_to_string ( char * format , va_list va ) {
goffset size ;
size = va_arg ( va , goffset ) ;
return g_format_size ( size ) ;
} |
-7,187,272,991,279,784,000 | debian | 3 | 0 | int DMA_read_memory ( int nchan , void * buf , int pos , int size ) {
return 0 ;
} |
3,309,252,579,593,081,300 | debian | 22 | 0 | static int nntp_group_poll ( struct NntpData * nntp_data , int update_stat ) {
char buf [ LONG_STRING ] = "" ;
anum_t count , first , last ;
if ( nntp_query ( nntp_data , buf , sizeof ( buf ) ) < 0 ) return - 1 ;
if ( sscanf ( buf , "211 " ANUM " " ANUM " " ANUM , & count , & first , & last ) != 3 ) return 0 ;
if ( first == nntp_data -> first_message && last == nntp_data -> last_message ) return 0 ;
if ( last < nntp_data -> last_message ) {
nntp_data -> last_cached = 0 ;
if ( nntp_data -> newsrc_len ) {
mutt_mem_realloc ( & nntp_data -> newsrc_ent , sizeof ( struct NewsrcEntry ) ) ;
nntp_data -> newsrc_len = 1 ;
nntp_data -> newsrc_ent [ 0 ] . first = 1 ;
nntp_data -> newsrc_ent [ 0 ] . last = 0 ;
}
}
nntp_data -> first_message = first ;
nntp_data -> last_message = last ;
if ( ! update_stat ) return 1 ;
else if ( ! last || ( ! nntp_data -> newsrc_ent && ! nntp_data -> last_cached ) ) nntp_data -> unread = count ;
else nntp_group_unread_stat ( nntp_data ) ;
return 1 ;
} |
3,426,991,998,365,732,400 | debian | 6 | 0 | static int ps2_mouse_post_load ( void * opaque , int version_id ) {
PS2MouseState * s = ( PS2MouseState * ) opaque ;
PS2State * ps2 = & s -> common ;
ps2_common_post_load ( ps2 ) ;
return 0 ;
} |
-8,620,097,311,326,519,000 | chrome | 79 | 0 | static err_status_t srtp_protect_rtcp_aead ( srtp_t ctx , srtp_stream_ctx_t * stream , void * rtcp_hdr , unsigned int * pkt_octet_len ) {
srtcp_hdr_t * hdr = ( srtcp_hdr_t * ) rtcp_hdr ;
uint32_t * enc_start ;
uint32_t * trailer ;
unsigned int enc_octet_len = 0 ;
uint8_t * auth_tag = NULL ;
err_status_t status ;
int tag_len ;
uint32_t seq_num ;
v128_t iv ;
uint32_t tseq ;
tag_len = auth_get_tag_length ( stream -> rtcp_auth ) ;
enc_start = ( uint32_t * ) hdr + uint32s_in_rtcp_header ;
enc_octet_len = * pkt_octet_len - octets_in_rtcp_header ;
trailer = ( uint32_t * ) ( ( char * ) enc_start + enc_octet_len + tag_len ) ;
if ( stream -> rtcp_services & sec_serv_conf ) {
* trailer = htonl ( SRTCP_E_BIT ) ;
}
else {
enc_start = NULL ;
enc_octet_len = 0 ;
* trailer = 0x00000000 ;
}
auth_tag = ( uint8_t * ) hdr + * pkt_octet_len ;
status = rdb_increment ( & stream -> rtcp_rdb ) ;
if ( status ) {
return status ;
}
seq_num = rdb_get_value ( & stream -> rtcp_rdb ) ;
* trailer |= htonl ( seq_num ) ;
debug_print ( mod_srtp , "srtcp index: %x" , seq_num ) ;
srtp_calc_aead_iv_srtcp ( stream , & iv , seq_num , hdr ) ;
status = cipher_set_iv ( stream -> rtcp_cipher , & iv , direction_encrypt ) ;
if ( status ) {
return err_status_cipher_fail ;
}
if ( enc_start ) {
status = cipher_set_aad ( stream -> rtcp_cipher , ( uint8_t * ) hdr , octets_in_rtcp_header ) ;
if ( status ) {
return ( err_status_cipher_fail ) ;
}
}
else {
status = cipher_set_aad ( stream -> rtcp_cipher , ( uint8_t * ) hdr , * pkt_octet_len ) ;
if ( status ) {
return ( err_status_cipher_fail ) ;
}
}
tseq = htonl ( * trailer ) ;
status = cipher_set_aad ( stream -> rtcp_cipher , ( uint8_t * ) & tseq , sizeof ( srtcp_trailer_t ) ) ;
if ( status ) {
return ( err_status_cipher_fail ) ;
}
if ( enc_start ) {
status = cipher_encrypt ( stream -> rtcp_cipher , ( uint8_t * ) enc_start , & enc_octet_len ) ;
if ( status ) {
return err_status_cipher_fail ;
}
status = cipher_get_tag ( stream -> rtcp_cipher , ( uint8_t * ) auth_tag , & tag_len ) ;
if ( status ) {
return ( err_status_cipher_fail ) ;
}
enc_octet_len += tag_len ;
}
else {
unsigned int nolen = 0 ;
status = cipher_encrypt ( stream -> rtcp_cipher , NULL , & nolen ) ;
if ( status ) {
return err_status_cipher_fail ;
}
status = cipher_get_tag ( stream -> rtcp_cipher , ( uint8_t * ) auth_tag , & tag_len ) ;
if ( status ) {
return ( err_status_cipher_fail ) ;
}
enc_octet_len += tag_len ;
}
* pkt_octet_len += ( tag_len + sizeof ( srtcp_trailer_t ) ) ;
return err_status_ok ;
} |
1,366,214,969,540,455,700 | debian | 307 | 0 | MSG_PROCESS_RETURN tls_process_client_hello ( SSL * s , PACKET * pkt ) {
int i , al = SSL_AD_INTERNAL_ERROR ;
unsigned int j , complen = 0 ;
unsigned long id ;
const SSL_CIPHER * c ;
# ifndef OPENSSL_NO_COMP SSL_COMP * comp = NULL ;
# endif STACK_OF ( SSL_CIPHER ) * ciphers = NULL ;
int protverr ;
PACKET session_id , cipher_suites , compression , extensions , cookie ;
int is_v2_record ;
static const unsigned char null_compression = 0 ;
is_v2_record = RECORD_LAYER_is_sslv2_record ( & s -> rlayer ) ;
PACKET_null_init ( & cookie ) ;
if ( is_v2_record ) {
unsigned int version ;
unsigned int mt ;
if ( ! PACKET_get_1 ( pkt , & mt ) || mt != SSL2_MT_CLIENT_HELLO ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , ERR_R_INTERNAL_ERROR ) ;
goto err ;
}
if ( ! PACKET_get_net_2 ( pkt , & version ) ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_UNKNOWN_PROTOCOL ) ;
goto err ;
}
if ( version == 0x0002 ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_UNKNOWN_PROTOCOL ) ;
goto err ;
}
else if ( ( version & 0xff00 ) == ( SSL3_VERSION_MAJOR << 8 ) ) {
s -> client_version = version ;
}
else {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_UNKNOWN_PROTOCOL ) ;
goto err ;
}
}
else {
if ( ! PACKET_get_net_2 ( pkt , ( unsigned int * ) & s -> client_version ) ) {
al = SSL_AD_DECODE_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_LENGTH_TOO_SHORT ) ;
goto f_err ;
}
}
if ( ! SSL_IS_DTLS ( s ) ) {
protverr = ssl_choose_server_version ( s ) ;
}
else if ( s -> method -> version != DTLS_ANY_VERSION && DTLS_VERSION_LT ( s -> client_version , s -> version ) ) {
protverr = SSL_R_VERSION_TOO_LOW ;
}
else {
protverr = 0 ;
}
if ( protverr ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , protverr ) ;
if ( ( ! s -> enc_write_ctx && ! s -> write_hash ) ) {
s -> version = s -> client_version ;
}
al = SSL_AD_PROTOCOL_VERSION ;
goto f_err ;
}
if ( is_v2_record ) {
unsigned int cipher_len , session_id_len , challenge_len ;
PACKET challenge ;
if ( ! PACKET_get_net_2 ( pkt , & cipher_len ) || ! PACKET_get_net_2 ( pkt , & session_id_len ) || ! PACKET_get_net_2 ( pkt , & challenge_len ) ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_RECORD_LENGTH_MISMATCH ) ;
al = SSL_AD_DECODE_ERROR ;
goto f_err ;
}
if ( session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH ) {
al = SSL_AD_DECODE_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_LENGTH_MISMATCH ) ;
goto f_err ;
}
if ( ! PACKET_get_sub_packet ( pkt , & cipher_suites , cipher_len ) || ! PACKET_get_sub_packet ( pkt , & session_id , session_id_len ) || ! PACKET_get_sub_packet ( pkt , & challenge , challenge_len ) || PACKET_remaining ( pkt ) != 0 ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_RECORD_LENGTH_MISMATCH ) ;
al = SSL_AD_DECODE_ERROR ;
goto f_err ;
}
challenge_len = challenge_len > SSL3_RANDOM_SIZE ? SSL3_RANDOM_SIZE : challenge_len ;
memset ( s -> s3 -> client_random , 0 , SSL3_RANDOM_SIZE ) ;
if ( ! PACKET_copy_bytes ( & challenge , s -> s3 -> client_random + SSL3_RANDOM_SIZE - challenge_len , challenge_len ) || ! PACKET_buf_init ( & compression , & null_compression , 1 ) ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , ERR_R_INTERNAL_ERROR ) ;
al = SSL_AD_INTERNAL_ERROR ;
goto f_err ;
}
PACKET_null_init ( & extensions ) ;
}
else {
if ( ! PACKET_copy_bytes ( pkt , s -> s3 -> client_random , SSL3_RANDOM_SIZE ) || ! PACKET_get_length_prefixed_1 ( pkt , & session_id ) ) {
al = SSL_AD_DECODE_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_LENGTH_MISMATCH ) ;
goto f_err ;
}
if ( PACKET_remaining ( & session_id ) > SSL_MAX_SSL_SESSION_ID_LENGTH ) {
al = SSL_AD_DECODE_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_LENGTH_MISMATCH ) ;
goto f_err ;
}
if ( SSL_IS_DTLS ( s ) ) {
if ( ! PACKET_get_length_prefixed_1 ( pkt , & cookie ) ) {
al = SSL_AD_DECODE_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_LENGTH_MISMATCH ) ;
goto f_err ;
}
if ( SSL_get_options ( s ) & SSL_OP_COOKIE_EXCHANGE ) {
if ( PACKET_remaining ( & cookie ) == 0 ) return 1 ;
}
}
if ( ! PACKET_get_length_prefixed_2 ( pkt , & cipher_suites ) || ! PACKET_get_length_prefixed_1 ( pkt , & compression ) ) {
al = SSL_AD_DECODE_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_LENGTH_MISMATCH ) ;
goto f_err ;
}
extensions = * pkt ;
}
if ( SSL_IS_DTLS ( s ) ) {
if ( SSL_get_options ( s ) & SSL_OP_COOKIE_EXCHANGE ) {
if ( s -> ctx -> app_verify_cookie_cb != NULL ) {
if ( s -> ctx -> app_verify_cookie_cb ( s , PACKET_data ( & cookie ) , PACKET_remaining ( & cookie ) ) == 0 ) {
al = SSL_AD_HANDSHAKE_FAILURE ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_COOKIE_MISMATCH ) ;
goto f_err ;
}
}
else if ( ! PACKET_equal ( & cookie , s -> d1 -> cookie , s -> d1 -> cookie_len ) ) {
al = SSL_AD_HANDSHAKE_FAILURE ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_COOKIE_MISMATCH ) ;
goto f_err ;
}
s -> d1 -> cookie_verified = 1 ;
}
if ( s -> method -> version == DTLS_ANY_VERSION ) {
protverr = ssl_choose_server_version ( s ) ;
if ( protverr != 0 ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , protverr ) ;
s -> version = s -> client_version ;
al = SSL_AD_PROTOCOL_VERSION ;
goto f_err ;
}
}
}
s -> hit = 0 ;
if ( is_v2_record || ( s -> new_session && ( s -> options & SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION ) ) ) {
if ( ! ssl_get_new_session ( s , 1 ) ) goto err ;
}
else {
i = ssl_get_prev_session ( s , & extensions , & session_id ) ;
if ( i == 1 && s -> version == s -> session -> ssl_version ) {
s -> hit = 1 ;
}
else if ( i == - 1 ) {
goto err ;
}
else {
if ( ! ssl_get_new_session ( s , 1 ) ) goto err ;
}
}
if ( ssl_bytes_to_cipher_list ( s , & cipher_suites , & ( ciphers ) , is_v2_record , & al ) == NULL ) {
goto f_err ;
}
if ( s -> hit ) {
j = 0 ;
id = s -> session -> cipher -> id ;
# ifdef CIPHER_DEBUG fprintf ( stderr , "client sent %d ciphers\n" , sk_SSL_CIPHER_num ( ciphers ) ) ;
# endif for ( i = 0 ;
i < sk_SSL_CIPHER_num ( ciphers ) ;
i ++ ) {
c = sk_SSL_CIPHER_value ( ciphers , i ) ;
# ifdef CIPHER_DEBUG fprintf ( stderr , "client [%2d of %2d]:%s\n" , i , sk_SSL_CIPHER_num ( ciphers ) , SSL_CIPHER_get_name ( c ) ) ;
# endif if ( c -> id == id ) {
j = 1 ;
break ;
}
}
if ( j == 0 ) {
al = SSL_AD_ILLEGAL_PARAMETER ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_REQUIRED_CIPHER_MISSING ) ;
goto f_err ;
}
}
complen = PACKET_remaining ( & compression ) ;
for ( j = 0 ;
j < complen ;
j ++ ) {
if ( PACKET_data ( & compression ) [ j ] == 0 ) break ;
}
if ( j >= complen ) {
al = SSL_AD_DECODE_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_NO_COMPRESSION_SPECIFIED ) ;
goto f_err ;
}
if ( s -> version >= SSL3_VERSION ) {
if ( ! ssl_parse_clienthello_tlsext ( s , & extensions ) ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_PARSE_TLSEXT ) ;
goto err ;
}
}
{
unsigned char * pos ;
pos = s -> s3 -> server_random ;
if ( ssl_fill_hello_random ( s , 1 , pos , SSL3_RANDOM_SIZE ) <= 0 ) {
goto f_err ;
}
}
if ( ! s -> hit && s -> version >= TLS1_VERSION && s -> tls_session_secret_cb ) {
const SSL_CIPHER * pref_cipher = NULL ;
s -> session -> master_key_length = sizeof ( s -> session -> master_key ) ;
if ( s -> tls_session_secret_cb ( s , s -> session -> master_key , & s -> session -> master_key_length , ciphers , & pref_cipher , s -> tls_session_secret_cb_arg ) ) {
s -> hit = 1 ;
s -> session -> ciphers = ciphers ;
s -> session -> verify_result = X509_V_OK ;
ciphers = NULL ;
pref_cipher = pref_cipher ? pref_cipher : ssl3_choose_cipher ( s , s -> session -> ciphers , SSL_get_ciphers ( s ) ) ;
if ( pref_cipher == NULL ) {
al = SSL_AD_HANDSHAKE_FAILURE ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_NO_SHARED_CIPHER ) ;
goto f_err ;
}
s -> session -> cipher = pref_cipher ;
sk_SSL_CIPHER_free ( s -> cipher_list ) ;
s -> cipher_list = sk_SSL_CIPHER_dup ( s -> session -> ciphers ) ;
sk_SSL_CIPHER_free ( s -> cipher_list_by_id ) ;
s -> cipher_list_by_id = sk_SSL_CIPHER_dup ( s -> session -> ciphers ) ;
}
}
s -> s3 -> tmp . new_compression = NULL ;
# ifndef OPENSSL_NO_COMP if ( s -> session -> compress_meth != 0 ) {
int m , comp_id = s -> session -> compress_meth ;
unsigned int k ;
if ( ! ssl_allow_compression ( s ) ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_INCONSISTENT_COMPRESSION ) ;
goto f_err ;
}
for ( m = 0 ;
m < sk_SSL_COMP_num ( s -> ctx -> comp_methods ) ;
m ++ ) {
comp = sk_SSL_COMP_value ( s -> ctx -> comp_methods , m ) ;
if ( comp_id == comp -> id ) {
s -> s3 -> tmp . new_compression = comp ;
break ;
}
}
if ( s -> s3 -> tmp . new_compression == NULL ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_INVALID_COMPRESSION_ALGORITHM ) ;
goto f_err ;
}
for ( k = 0 ;
k < complen ;
k ++ ) {
if ( PACKET_data ( & compression ) [ k ] == comp_id ) break ;
}
if ( k >= complen ) {
al = SSL_AD_ILLEGAL_PARAMETER ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING ) ;
goto f_err ;
}
}
else if ( s -> hit ) comp = NULL ;
else if ( ssl_allow_compression ( s ) && s -> ctx -> comp_methods ) {
int m , nn , v , done = 0 ;
unsigned int o ;
nn = sk_SSL_COMP_num ( s -> ctx -> comp_methods ) ;
for ( m = 0 ;
m < nn ;
m ++ ) {
comp = sk_SSL_COMP_value ( s -> ctx -> comp_methods , m ) ;
v = comp -> id ;
for ( o = 0 ;
o < complen ;
o ++ ) {
if ( v == PACKET_data ( & compression ) [ o ] ) {
done = 1 ;
break ;
}
}
if ( done ) break ;
}
if ( done ) s -> s3 -> tmp . new_compression = comp ;
else comp = NULL ;
}
# else if ( s -> session -> compress_meth != 0 ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_INCONSISTENT_COMPRESSION ) ;
goto f_err ;
}
# endif if ( ! s -> hit ) {
# ifdef OPENSSL_NO_COMP s -> session -> compress_meth = 0 ;
# else s -> session -> compress_meth = ( comp == NULL ) ? 0 : comp -> id ;
# endif sk_SSL_CIPHER_free ( s -> session -> ciphers ) ;
s -> session -> ciphers = ciphers ;
if ( ciphers == NULL ) {
al = SSL_AD_INTERNAL_ERROR ;
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , ERR_R_INTERNAL_ERROR ) ;
goto f_err ;
}
ciphers = NULL ;
if ( ! tls1_set_server_sigalgs ( s ) ) {
SSLerr ( SSL_F_TLS_PROCESS_CLIENT_HELLO , SSL_R_CLIENTHELLO_TLSEXT ) ;
goto err ;
}
}
sk_SSL_CIPHER_free ( ciphers ) ;
return MSG_PROCESS_CONTINUE_PROCESSING ;
f_err : ssl3_send_alert ( s , SSL3_AL_FATAL , al ) ;
err : ossl_statem_set_error ( s ) ;
sk_SSL_CIPHER_free ( ciphers ) ;
return MSG_PROCESS_ERROR ;
} |
-1,983,921,383,858,884,000 | debian | 44 | 0 | static void ipvideo_decode_opcodes ( IpvideoContext * s , AVFrame * frame ) {
int x , y ;
unsigned char opcode ;
int ret ;
GetBitContext gb ;
bytestream2_skip ( & s -> stream_ptr , 14 ) ;
if ( ! s -> is_16bpp ) {
memcpy ( frame -> data [ 1 ] , s -> pal , AVPALETTE_SIZE ) ;
s -> stride = frame -> linesize [ 0 ] ;
}
else {
s -> stride = frame -> linesize [ 0 ] >> 1 ;
s -> mv_ptr = s -> stream_ptr ;
bytestream2_skip ( & s -> mv_ptr , bytestream2_get_le16 ( & s -> stream_ptr ) ) ;
}
s -> line_inc = s -> stride - 8 ;
s -> upper_motion_limit_offset = ( s -> avctx -> height - 8 ) * frame -> linesize [ 0 ] + ( s -> avctx -> width - 8 ) * ( 1 + s -> is_16bpp ) ;
init_get_bits ( & gb , s -> decoding_map , s -> decoding_map_size * 8 ) ;
for ( y = 0 ;
y < s -> avctx -> height ;
y += 8 ) {
for ( x = 0 ;
x < s -> avctx -> width ;
x += 8 ) {
opcode = get_bits ( & gb , 4 ) ;
av_dlog ( s -> avctx , " block @ (%3d, %3d): encoding 0x%X, data ptr offset %d\n" , x , y , opcode , bytestream2_tell ( & s -> stream_ptr ) ) ;
if ( ! s -> is_16bpp ) {
s -> pixel_ptr = frame -> data [ 0 ] + x + y * frame -> linesize [ 0 ] ;
ret = ipvideo_decode_block [ opcode ] ( s , frame ) ;
}
else {
s -> pixel_ptr = frame -> data [ 0 ] + x * 2 + y * frame -> linesize [ 0 ] ;
ret = ipvideo_decode_block16 [ opcode ] ( s , frame ) ;
}
if ( ret != 0 ) {
av_log ( s -> avctx , AV_LOG_ERROR , " Interplay video: decode problem on frame %d, @ block (%d, %d)\n" , s -> avctx -> frame_number , x , y ) ;
return ;
}
}
}
if ( bytestream2_get_bytes_left ( & s -> stream_ptr ) > 1 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "Interplay video: decode finished with %d bytes left over\n" , bytestream2_get_bytes_left ( & s -> stream_ptr ) ) ;
}
} |
6,336,384,260,629,386,000 | debian | 16 | 0 | static void dissect_zcl_groups_view_group_response ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
guint attr_uint ;
guint8 * attr_string ;
proto_tree_add_item ( tree , hf_zbee_zcl_groups_status , tvb , * offset , 1 , ENC_LITTLE_ENDIAN ) ;
* offset += 1 ;
proto_tree_add_item ( tree , hf_zbee_zcl_groups_group_id , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
attr_uint = tvb_get_guint8 ( tvb , * offset ) ;
if ( attr_uint == 0xff ) attr_uint = 0 ;
proto_tree_add_uint ( tree , hf_zbee_zcl_groups_attr_str_len , tvb , * offset , 1 , attr_uint ) ;
* offset += 1 ;
attr_string = tvb_get_string_enc ( wmem_packet_scope ( ) , tvb , * offset , attr_uint , ENC_ASCII ) ;
proto_item_append_text ( tree , ", String: %s" , attr_string ) ;
proto_tree_add_string ( tree , hf_zbee_zcl_groups_attr_str , tvb , * offset , attr_uint , attr_string ) ;
* offset += attr_uint ;
} |
370,610,032,569,630,460 | debian | 15 | 0 | static int tls1_generate_key_block ( SSL * s , unsigned char * km , unsigned char * tmp , int num ) {
int ret ;
ret = tls1_PRF ( ssl_get_algorithm2 ( s ) , TLS_MD_KEY_EXPANSION_CONST , TLS_MD_KEY_EXPANSION_CONST_SIZE , s -> s3 -> server_random , SSL3_RANDOM_SIZE , s -> s3 -> client_random , SSL3_RANDOM_SIZE , NULL , 0 , NULL , 0 , s -> session -> master_key , s -> session -> master_key_length , km , tmp , num ) ;
# ifdef KSSL_DEBUG printf ( "tls1_generate_key_block() ==> %d byte master_key =\n\t" , s -> session -> master_key_length ) ;
{
int i ;
for ( i = 0 ;
i < s -> session -> master_key_length ;
i ++ ) {
printf ( "%02X" , s -> session -> master_key [ i ] ) ;
}
printf ( "\n" ) ;
}
# endif return ret ;
} |
-6,966,071,246,558,644,000 | chrome | 4 | 0 | static void * DefaultAllocFunc ( void * opaque , size_t size ) {
BROTLI_UNUSED ( opaque ) ;
return malloc ( size ) ;
} |
-1,338,403,456,839,869,200 | debian | 4 | 0 | static void dissect_q931_notification_indicator_ie ( tvbuff_t * tvb , int offset , int len , proto_tree * tree ) {
if ( len == 0 ) return ;
proto_tree_add_item ( tree , hf_q931_notification_description , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
} |
-571,446,645,408,709,060 | debian | 26 | 0 | static void * read_into_buffer ( FILE * fp , size_t * r_length ) {
char * buffer ;
size_t buflen ;
size_t nread , bufsize = 0 ;
* r_length = 0 ;
# define NCHUNK 8192 # ifdef HAVE_W32_SYSTEM setmode ( fileno ( fp ) , O_BINARY ) ;
# endif buffer = NULL ;
buflen = 0 ;
do {
bufsize += NCHUNK ;
buffer = realloc ( buffer , bufsize ) ;
if ( ! buffer ) {
perror ( "realloc failed" ) ;
exit ( 1 ) ;
}
nread = fread ( buffer + buflen , 1 , NCHUNK , fp ) ;
if ( nread < NCHUNK && ferror ( fp ) ) {
perror ( "fread failed" ) ;
exit ( 1 ) ;
}
buflen += nread ;
}
while ( nread == NCHUNK ) ;
# undef NCHUNK * r_length = buflen ;
return buffer ;
} |
7,191,899,184,788,440,000 | debian | 3 | 0 | static void end_pager ( ) {
# ifdef USE_POPEN if ( ! opt_nopager ) pclose ( PAGER ) ;
# endif } |
-1,968,566,663,266,802,400 | chrome | 7 | 0 | TEST_F ( OmniboxViewViewsTest , ScheduledTextEditCommand ) {
omnibox_textfield ( ) -> SetTextEditCommandForNextKeyEvent ( ui : : TextEditCommand : : MOVE_UP ) ;
EXPECT_EQ ( ui : : TextEditCommand : : MOVE_UP , scheduled_text_edit_command ( ) ) ;
ui : : KeyEvent up_pressed ( ui : : ET_KEY_PRESSED , ui : : VKEY_UP , 0 ) ;
omnibox_textfield ( ) -> OnKeyEvent ( & up_pressed ) ;
EXPECT_EQ ( ui : : TextEditCommand : : INVALID_COMMAND , scheduled_text_edit_command ( ) ) ;
} |
-7,042,392,412,001,533,000 | debian | 13 | 0 | static void add_mrange ( fz_context * ctx , pdf_cmap * cmap , unsigned int low , int * out , int len ) {
int out_pos ;
if ( cmap -> dlen + len + 1 > cmap -> dcap ) {
int new_cap = cmap -> dcap ? cmap -> dcap * 2 : 256 ;
cmap -> dict = fz_resize_array ( ctx , cmap -> dict , new_cap , sizeof * cmap -> dict ) ;
cmap -> dcap = new_cap ;
}
out_pos = cmap -> dlen ;
cmap -> dict [ out_pos ] = len ;
memcpy ( & cmap -> dict [ out_pos + 1 ] , out , sizeof ( int ) * len ) ;
cmap -> dlen += len + 1 ;
add_range ( ctx , cmap , low , low , out_pos , 1 , 1 ) ;
} |
313,627,013,719,508,800 | debian | 3 | 0 | static inline PixelTrait GetPixelYTraits ( const Image * restrict image ) {
return ( image -> channel_map [ YPixelChannel ] . traits ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_RedundancyEncodingMode ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_RedundancyEncodingMode , RedundancyEncodingMode_sequence ) ;
return offset ;
} |
-5,018,199,117,312,371,000 | chrome | 24 | 0 | static void y4m_convert_422_420jpeg ( y4m_input * _y4m , unsigned char * _dst , unsigned char * _aux ) {
unsigned char * tmp ;
int c_w ;
int c_h ;
int c_sz ;
int dst_c_h ;
int dst_c_sz ;
int pli ;
_dst += _y4m -> pic_w * _y4m -> pic_h ;
c_w = ( _y4m -> pic_w + _y4m -> src_c_dec_h - 1 ) / _y4m -> src_c_dec_h ;
c_h = _y4m -> pic_h ;
dst_c_h = ( _y4m -> pic_h + _y4m -> dst_c_dec_v - 1 ) / _y4m -> dst_c_dec_v ;
c_sz = c_w * c_h ;
dst_c_sz = c_w * dst_c_h ;
tmp = _aux + 2 * c_sz ;
for ( pli = 1 ;
pli < 3 ;
pli ++ ) {
y4m_42xmpeg2_42xjpeg_helper ( tmp , _aux , c_w , c_h ) ;
y4m_422jpeg_420jpeg_helper ( _dst , tmp , c_w , c_h ) ;
_aux += c_sz ;
_dst += dst_c_sz ;
}
} |
-1,315,695,702,746,584,300 | debian | 8 | 0 | void proto_registrar_dump_ftypes ( void ) {
int fte ;
for ( fte = 0 ;
fte < FT_NUM_TYPES ;
fte ++ ) {
ws_debug_printf ( "%s\t%s\n" , ftype_name ( ( ftenum_t ) fte ) , ftype_pretty_name ( ( ftenum_t ) fte ) ) ;
}
} |
8,193,534,372,312,945,000 | debian | 13 | 0 | uint32_t pcnet_bcr_readw ( PCNetState * s , uint32_t rap ) {
uint32_t val ;
rap &= 127 ;
switch ( rap ) {
case BCR_LNKST : case BCR_LED1 : case BCR_LED2 : case BCR_LED3 : val = s -> bcr [ rap ] & ~ 0x8000 ;
val |= ( val & 0x017f & s -> lnkst ) ? 0x8000 : 0 ;
break ;
default : val = rap < 32 ? s -> bcr [ rap ] : 0 ;
break ;
}
# ifdef PCNET_DEBUG_BCR printf ( "pcnet_bcr_readw rap=%d val=0x%04x\n" , rap , val ) ;
# endif return val ;
} |
6,632,536,031,698,733,000 | debian | 6 | 0 | static inline void writer_print_rational ( WriterContext * wctx , const char * key , AVRational q , char sep ) {
AVBPrint buf ;
av_bprint_init ( & buf , 0 , AV_BPRINT_SIZE_AUTOMATIC ) ;
av_bprintf ( & buf , "%d%c%d" , q . num , sep , q . den ) ;
writer_print_string ( wctx , key , buf . str , 0 ) ;
} |
-7,455,544,248,455,991,000 | debian | 6 | 0 | int kvm_device_msix_set_vector ( KVMState * s , uint32_t dev_id , uint32_t vector , int virq ) {
struct kvm_assigned_msix_entry msix_entry = {
. assigned_dev_id = dev_id , . gsi = virq , . entry = vector , }
;
return kvm_vm_ioctl ( s , KVM_ASSIGN_SET_MSIX_ENTRY , & msix_entry ) ;
} |
-6,024,601,983,167,899,000 | debian | 24 | 0 | static void show_unhandled_type_error ( ActivateParametersInstall * parameters ) {
GtkWidget * dialog ;
char * mime_type = nautilus_file_get_mime_type ( parameters -> file ) ;
char * error_message = get_application_no_mime_type_handler_message ( parameters -> file , parameters -> uri ) ;
if ( g_content_type_is_unknown ( mime_type ) ) {
dialog = gtk_message_dialog_new ( parameters -> parent_window , GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL , GTK_MESSAGE_ERROR , 0 , "%s" , error_message ) ;
gtk_message_dialog_format_secondary_text ( GTK_MESSAGE_DIALOG ( dialog ) , _ ( "The file is of an unknown type" ) ) ;
}
else {
char * text ;
text = g_strdup_printf ( _ ( "There is no application installed for “%s” files" ) , g_content_type_get_description ( mime_type ) ) ;
dialog = gtk_message_dialog_new ( parameters -> parent_window , GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL , GTK_MESSAGE_ERROR , 0 , "%s" , error_message ) ;
gtk_message_dialog_format_secondary_text ( GTK_MESSAGE_DIALOG ( dialog ) , "%s" , text ) ;
g_free ( text ) ;
}
gtk_dialog_add_button ( GTK_DIALOG ( dialog ) , _ ( "_Select Application" ) , GTK_RESPONSE_ACCEPT ) ;
gtk_dialog_add_button ( GTK_DIALOG ( dialog ) , _ ( "_OK" ) , GTK_RESPONSE_OK ) ;
gtk_dialog_set_default_response ( GTK_DIALOG ( dialog ) , GTK_RESPONSE_OK ) ;
g_object_set_data_full ( G_OBJECT ( dialog ) , "mime-action:file" , nautilus_file_ref ( parameters -> file ) , ( GDestroyNotify ) nautilus_file_unref ) ;
gtk_widget_show ( GTK_WIDGET ( dialog ) ) ;
g_signal_connect ( dialog , "response" , G_CALLBACK ( choose_program ) , parameters ) ;
g_free ( error_message ) ;
g_free ( mime_type ) ;
} |
-3,146,697,469,509,848,600 | debian | 70 | 1 | static int dsa_priv_decode ( EVP_PKEY * pkey , PKCS8_PRIV_KEY_INFO * p8 ) {
const unsigned char * p , * pm ;
int pklen , pmlen ;
int ptype ;
void * pval ;
ASN1_STRING * pstr ;
X509_ALGOR * palg ;
ASN1_INTEGER * privkey = NULL ;
BN_CTX * ctx = NULL ;
STACK_OF ( ASN1_TYPE ) * ndsa = NULL ;
DSA * dsa = NULL ;
if ( ! PKCS8_pkey_get0 ( NULL , & p , & pklen , & palg , p8 ) ) return 0 ;
X509_ALGOR_get0 ( NULL , & ptype , & pval , palg ) ;
if ( * p == ( V_ASN1_SEQUENCE | V_ASN1_CONSTRUCTED ) ) {
ASN1_TYPE * t1 , * t2 ;
if ( ( ndsa = d2i_ASN1_SEQUENCE_ANY ( NULL , & p , pklen ) ) == NULL ) goto decerr ;
if ( sk_ASN1_TYPE_num ( ndsa ) != 2 ) goto decerr ;
t1 = sk_ASN1_TYPE_value ( ndsa , 0 ) ;
t2 = sk_ASN1_TYPE_value ( ndsa , 1 ) ;
if ( t1 -> type == V_ASN1_SEQUENCE ) {
p8 -> broken = PKCS8_EMBEDDED_PARAM ;
pval = t1 -> value . ptr ;
}
else if ( ptype == V_ASN1_SEQUENCE ) p8 -> broken = PKCS8_NS_DB ;
else goto decerr ;
if ( t2 -> type != V_ASN1_INTEGER ) goto decerr ;
privkey = t2 -> value . integer ;
}
else {
const unsigned char * q = p ;
if ( ( privkey = d2i_ASN1_INTEGER ( NULL , & p , pklen ) ) == NULL ) goto decerr ;
if ( privkey -> type == V_ASN1_NEG_INTEGER ) {
p8 -> broken = PKCS8_NEG_PRIVKEY ;
ASN1_STRING_clear_free ( privkey ) ;
if ( ( privkey = d2i_ASN1_UINTEGER ( NULL , & q , pklen ) ) == NULL ) goto decerr ;
}
if ( ptype != V_ASN1_SEQUENCE ) goto decerr ;
}
pstr = pval ;
pm = pstr -> data ;
pmlen = pstr -> length ;
if ( ( dsa = d2i_DSAparams ( NULL , & pm , pmlen ) ) == NULL ) goto decerr ;
if ( ( dsa -> priv_key = BN_secure_new ( ) ) == NULL || ! ASN1_INTEGER_to_BN ( privkey , dsa -> priv_key ) ) {
DSAerr ( DSA_F_DSA_PRIV_DECODE , DSA_R_BN_ERROR ) ;
goto dsaerr ;
}
if ( ( dsa -> pub_key = BN_new ( ) ) == NULL ) {
DSAerr ( DSA_F_DSA_PRIV_DECODE , ERR_R_MALLOC_FAILURE ) ;
goto dsaerr ;
}
if ( ( ctx = BN_CTX_new ( ) ) == NULL ) {
DSAerr ( DSA_F_DSA_PRIV_DECODE , ERR_R_MALLOC_FAILURE ) ;
goto dsaerr ;
}
if ( ! BN_mod_exp ( dsa -> pub_key , dsa -> g , dsa -> priv_key , dsa -> p , ctx ) ) {
DSAerr ( DSA_F_DSA_PRIV_DECODE , DSA_R_BN_ERROR ) ;
goto dsaerr ;
}
EVP_PKEY_assign_DSA ( pkey , dsa ) ;
BN_CTX_free ( ctx ) ;
if ( ndsa ) sk_ASN1_TYPE_pop_free ( ndsa , ASN1_TYPE_free ) ;
else ASN1_STRING_clear_free ( privkey ) ;
return 1 ;
decerr : DSAerr ( DSA_F_DSA_PRIV_DECODE , DSA_R_DECODE_ERROR ) ;
dsaerr : BN_CTX_free ( ctx ) ;
ASN1_STRING_clear_free ( privkey ) ;
sk_ASN1_TYPE_pop_free ( ndsa , ASN1_TYPE_free ) ;
DSA_free ( dsa ) ;
return 0 ;
} |
-4,295,537,452,468,300,300 | debian | 31 | 0 | static int ir2_decode_plane_inter ( Ir2Context * ctx , int width , int height , uint8_t * dst , int stride , const uint8_t * table ) {
int j ;
int out = 0 ;
int c ;
int t ;
if ( width & 1 ) return AVERROR_INVALIDDATA ;
for ( j = 0 ;
j < height ;
j ++ ) {
out = 0 ;
while ( out < width ) {
c = ir2_get_code ( & ctx -> gb ) ;
if ( c >= 0x80 ) {
c -= 0x7F ;
out += c * 2 ;
}
else {
t = dst [ out ] + ( ( ( table [ c * 2 ] - 128 ) * 3 ) >> 2 ) ;
t = av_clip_uint8 ( t ) ;
dst [ out ] = t ;
out ++ ;
t = dst [ out ] + ( ( ( table [ ( c * 2 ) + 1 ] - 128 ) * 3 ) >> 2 ) ;
t = av_clip_uint8 ( t ) ;
dst [ out ] = t ;
out ++ ;
}
}
dst += stride ;
}
return 0 ;
} |
-1,672,864,273,235,910,400 | debian | 48 | 0 | static void _slurm_rpc_update_powercap ( slurm_msg_t * msg ) {
int error_code = SLURM_SUCCESS ;
DEF_TIMERS ;
bool valid_cap = false ;
uint32_t min , max , orig_cap ;
update_powercap_msg_t * ptr = ( update_powercap_msg_t * ) msg -> data ;
slurmctld_lock_t config_write_lock = {
WRITE_LOCK , NO_LOCK , READ_LOCK , NO_LOCK , NO_LOCK }
;
uid_t uid = g_slurm_auth_get_uid ( msg -> auth_cred , slurmctld_config . auth_info ) ;
START_TIMER ;
debug2 ( "Processing RPC: REQUEST_UPDATE_POWERCAP from uid=%d" , uid ) ;
if ( ! validate_super_user ( uid ) ) {
error_code = ESLURM_USER_ID_MISSING ;
error ( "Security violation, UPDATE_POWERCAP RPC from uid=%d" , uid ) ;
}
if ( error_code == SLURM_SUCCESS ) {
lock_slurmctld ( config_write_lock ) ;
if ( ptr -> power_cap == 0 || ptr -> power_cap == INFINITE ) {
valid_cap = true ;
}
else if ( ! power_layout_ready ( ) ) {
valid_cap = true ;
}
else {
orig_cap = powercap_get_cluster_current_cap ( ) ;
powercap_set_cluster_cap ( INFINITE ) ;
min = powercap_get_cluster_min_watts ( ) ;
max = powercap_get_cluster_max_watts ( ) ;
if ( min <= ptr -> power_cap && max >= ptr -> power_cap ) valid_cap = true ;
else powercap_set_cluster_cap ( orig_cap ) ;
}
if ( valid_cap ) powercap_set_cluster_cap ( ptr -> power_cap ) ;
else error_code = ESLURM_INVALID_POWERCAP ;
unlock_slurmctld ( config_write_lock ) ;
END_TIMER2 ( "_slurm_rpc_update_powercap" ) ;
}
if ( error_code ) {
info ( "_slurm_rpc_update_powercap: %s" , slurm_strerror ( error_code ) ) ;
slurm_send_rc_msg ( msg , error_code ) ;
}
else {
debug2 ( "_slurm_rpc_update_powercap complete %s" , TIME_STR ) ;
slurm_send_rc_msg ( msg , SLURM_SUCCESS ) ;
if ( ! LOTS_OF_AGENTS ) schedule ( 0 ) ;
save_all_state ( ) ;
}
} |
136,942,900,289,772,930 | debian | 145 | 1 | static int cine_read_header ( AVFormatContext * avctx ) {
AVIOContext * pb = avctx -> pb ;
AVStream * st ;
unsigned int version , compression , offImageHeader , offSetup , offImageOffsets , biBitCount , length , CFA ;
int vflip ;
char * description ;
uint64_t i ;
st = avformat_new_stream ( avctx , NULL ) ;
if ( ! st ) return AVERROR ( ENOMEM ) ;
st -> codecpar -> codec_type = AVMEDIA_TYPE_VIDEO ;
st -> codecpar -> codec_id = AV_CODEC_ID_RAWVIDEO ;
st -> codecpar -> codec_tag = 0 ;
avio_skip ( pb , 4 ) ;
compression = avio_rl16 ( pb ) ;
version = avio_rl16 ( pb ) ;
if ( version != 1 ) {
avpriv_request_sample ( avctx , "unknown version %i" , version ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 12 ) ;
st -> duration = avio_rl32 ( pb ) ;
offImageHeader = avio_rl32 ( pb ) ;
offSetup = avio_rl32 ( pb ) ;
offImageOffsets = avio_rl32 ( pb ) ;
avio_skip ( pb , 8 ) ;
avio_seek ( pb , offImageHeader , SEEK_SET ) ;
avio_skip ( pb , 4 ) ;
st -> codecpar -> width = avio_rl32 ( pb ) ;
st -> codecpar -> height = avio_rl32 ( pb ) ;
if ( avio_rl16 ( pb ) != 1 ) return AVERROR_INVALIDDATA ;
biBitCount = avio_rl16 ( pb ) ;
if ( biBitCount != 8 && biBitCount != 16 && biBitCount != 24 && biBitCount != 48 ) {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
switch ( avio_rl32 ( pb ) ) {
case BMP_RGB : vflip = 0 ;
break ;
case 0x100 : st -> codecpar -> codec_tag = MKTAG ( 'B' , 'I' , 'T' , 0 ) ;
vflip = 1 ;
break ;
default : avpriv_request_sample ( avctx , "unknown bitmap compression" ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 4 ) ;
avio_seek ( pb , offSetup , SEEK_SET ) ;
avio_skip ( pb , 140 ) ;
if ( avio_rl16 ( pb ) != 0x5453 ) return AVERROR_INVALIDDATA ;
length = avio_rl16 ( pb ) ;
if ( length < 0x163C ) {
avpriv_request_sample ( avctx , "short SETUP header" ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 616 ) ;
if ( ! avio_rl32 ( pb ) ^ vflip ) {
st -> codecpar -> extradata = av_strdup ( "BottomUp" ) ;
st -> codecpar -> extradata_size = 9 ;
}
avio_skip ( pb , 4 ) ;
avpriv_set_pts_info ( st , 64 , 1 , avio_rl32 ( pb ) ) ;
avio_skip ( pb , 20 ) ;
set_metadata_int ( & st -> metadata , "camera_version" , avio_rl32 ( pb ) , 0 ) ;
set_metadata_int ( & st -> metadata , "firmware_version" , avio_rl32 ( pb ) , 0 ) ;
set_metadata_int ( & st -> metadata , "software_version" , avio_rl32 ( pb ) , 0 ) ;
set_metadata_int ( & st -> metadata , "recording_timezone" , avio_rl32 ( pb ) , 0 ) ;
CFA = avio_rl32 ( pb ) ;
set_metadata_int ( & st -> metadata , "brightness" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "contrast" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "gamma" , avio_rl32 ( pb ) , 1 ) ;
avio_skip ( pb , 12 + 16 ) ;
set_metadata_float ( & st -> metadata , "wbgain[0].r" , av_int2float ( avio_rl32 ( pb ) ) , 1 ) ;
set_metadata_float ( & st -> metadata , "wbgain[0].b" , av_int2float ( avio_rl32 ( pb ) ) , 1 ) ;
avio_skip ( pb , 36 ) ;
st -> codecpar -> bits_per_coded_sample = avio_rl32 ( pb ) ;
if ( compression == CC_RGB ) {
if ( biBitCount == 8 ) {
st -> codecpar -> format = AV_PIX_FMT_GRAY8 ;
}
else if ( biBitCount == 16 ) {
st -> codecpar -> format = AV_PIX_FMT_GRAY16LE ;
}
else if ( biBitCount == 24 ) {
st -> codecpar -> format = AV_PIX_FMT_BGR24 ;
}
else if ( biBitCount == 48 ) {
st -> codecpar -> format = AV_PIX_FMT_BGR48LE ;
}
else {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
}
else if ( compression == CC_UNINT ) {
switch ( CFA & 0xFFFFFF ) {
case CFA_BAYER : if ( biBitCount == 8 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_GBRG8 ;
}
else if ( biBitCount == 16 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_GBRG16LE ;
}
else {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
break ;
case CFA_BAYERFLIP : if ( biBitCount == 8 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_RGGB8 ;
}
else if ( biBitCount == 16 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_RGGB16LE ;
}
else {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
break ;
default : avpriv_request_sample ( avctx , "unsupported Color Field Array (CFA) %i" , CFA & 0xFFFFFF ) ;
return AVERROR_INVALIDDATA ;
}
}
else {
avpriv_request_sample ( avctx , "unsupported compression %i" , compression ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 668 ) ;
set_metadata_int ( & st -> metadata , "shutter_ns" , avio_rl32 ( pb ) , 0 ) ;
avio_skip ( pb , 24 ) ;
# define DESCRIPTION_SIZE 4096 description = av_malloc ( DESCRIPTION_SIZE + 1 ) ;
if ( ! description ) return AVERROR ( ENOMEM ) ;
i = avio_get_str ( pb , DESCRIPTION_SIZE , description , DESCRIPTION_SIZE + 1 ) ;
if ( i < DESCRIPTION_SIZE ) avio_skip ( pb , DESCRIPTION_SIZE - i ) ;
if ( description [ 0 ] ) av_dict_set ( & st -> metadata , "description" , description , AV_DICT_DONT_STRDUP_VAL ) ;
else av_free ( description ) ;
avio_skip ( pb , 1176 ) ;
set_metadata_int ( & st -> metadata , "enable_crop" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_left" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_top" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_right" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_bottom" , avio_rl32 ( pb ) , 1 ) ;
avio_seek ( pb , offImageOffsets , SEEK_SET ) ;
for ( i = 0 ;
i < st -> duration ;
i ++ ) av_add_index_entry ( st , avio_rl64 ( pb ) , i , 0 , 0 , AVINDEX_KEYFRAME ) ;
return 0 ;
} |
-2,607,754,285,145,856,500 | debian | 17 | 0 | static int wb_write_out ( struct archive_write * a ) {
struct iso9660 * iso9660 = ( struct iso9660 * ) a -> format_data ;
size_t wsize , nw ;
int r ;
wsize = sizeof ( iso9660 -> wbuff ) - iso9660 -> wbuff_remaining ;
nw = wsize % LOGICAL_BLOCK_SIZE ;
if ( iso9660 -> wbuff_type == WB_TO_STREAM ) r = __archive_write_output ( a , iso9660 -> wbuff , wsize - nw ) ;
else r = write_to_temp ( a , iso9660 -> wbuff , wsize - nw ) ;
iso9660 -> wbuff_offset += wsize - nw ;
if ( iso9660 -> wbuff_offset > iso9660 -> wbuff_written ) iso9660 -> wbuff_written = iso9660 -> wbuff_offset ;
iso9660 -> wbuff_remaining = sizeof ( iso9660 -> wbuff ) ;
if ( nw ) {
iso9660 -> wbuff_remaining -= nw ;
memmove ( iso9660 -> wbuff , iso9660 -> wbuff + wsize - nw , nw ) ;
}
return ( r ) ;
} |
9,111,838,939,241,886,000 | chrome | 72 | 0 | int MBS_ApplyPatch ( const MBSPatchHeader * header , int patchfd , unsigned char * fbuffer , int filefd ) {
unsigned char * fbufstart = fbuffer ;
unsigned char * fbufend = fbuffer + header -> slen ;
unsigned char * buf = ( unsigned char * ) malloc ( header -> cblen + header -> difflen + header -> extralen ) ;
if ( ! buf ) return MEM_ERROR ;
int rv = OK ;
int r = header -> cblen + header -> difflen + header -> extralen ;
unsigned char * wb = buf ;
while ( r ) {
int c = read ( patchfd , wb , ( r > SSIZE_MAX ) ? SSIZE_MAX : r ) ;
if ( c < 0 ) {
rv = READ_ERROR ;
goto end ;
}
r -= c ;
wb += c ;
if ( c == 0 && r ) {
rv = UNEXPECTED_ERROR ;
goto end ;
}
}
{
MBSPatchTriple * ctrlsrc = ( MBSPatchTriple * ) buf ;
if ( header -> cblen % sizeof ( MBSPatchTriple ) != 0 ) {
rv = UNEXPECTED_ERROR ;
goto end ;
}
unsigned char * diffsrc = buf + header -> cblen ;
unsigned char * extrasrc = diffsrc + header -> difflen ;
MBSPatchTriple * ctrlend = ( MBSPatchTriple * ) diffsrc ;
unsigned char * diffend = extrasrc ;
unsigned char * extraend = extrasrc + header -> extralen ;
while ( ctrlsrc < ctrlend ) {
ctrlsrc -> x = ntohl ( ctrlsrc -> x ) ;
ctrlsrc -> y = ntohl ( ctrlsrc -> y ) ;
ctrlsrc -> z = ntohl ( ctrlsrc -> z ) ;
# ifdef DEBUG_bsmedberg printf ( "Applying block:\n" " x: %u\n" " y: %u\n" " z: %i\n" , ctrlsrc -> x , ctrlsrc -> y , ctrlsrc -> z ) ;
# endif if ( ctrlsrc -> x > static_cast < size_t > ( fbufend - fbuffer ) || ctrlsrc -> x > static_cast < size_t > ( diffend - diffsrc ) ) {
rv = UNEXPECTED_ERROR ;
goto end ;
}
for ( unsigned int i = 0 ;
i < ctrlsrc -> x ;
++ i ) {
diffsrc [ i ] += fbuffer [ i ] ;
}
if ( ( int ) write ( filefd , diffsrc , ctrlsrc -> x ) != ctrlsrc -> x ) {
rv = WRITE_ERROR ;
goto end ;
}
fbuffer += ctrlsrc -> x ;
diffsrc += ctrlsrc -> x ;
if ( ctrlsrc -> y > static_cast < size_t > ( extraend - extrasrc ) ) {
rv = UNEXPECTED_ERROR ;
goto end ;
}
if ( ( int ) write ( filefd , extrasrc , ctrlsrc -> y ) != ctrlsrc -> y ) {
rv = WRITE_ERROR ;
goto end ;
}
extrasrc += ctrlsrc -> y ;
if ( ctrlsrc -> z < fbufstart - fbuffer || ctrlsrc -> z > fbufend - fbuffer ) {
rv = UNEXPECTED_ERROR ;
goto end ;
}
fbuffer += ctrlsrc -> z ;
++ ctrlsrc ;
}
}
end : free ( buf ) ;
return rv ;
} |
-3,943,803,018,993,195,500 | debian | 53 | 1 | static int ra144_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
AVFrame * frame = data ;
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
static const uint8_t sizes [ LPC_ORDER ] = {
6 , 5 , 5 , 4 , 4 , 3 , 3 , 3 , 3 , 2 }
;
unsigned int refl_rms [ NBLOCKS ] ;
uint16_t block_coefs [ NBLOCKS ] [ LPC_ORDER ] ;
unsigned int lpc_refl [ LPC_ORDER ] ;
int i , j ;
int ret ;
int16_t * samples ;
unsigned int energy ;
RA144Context * ractx = avctx -> priv_data ;
GetBitContext gb ;
frame -> nb_samples = NBLOCKS * BLOCKSIZE ;
if ( ( ret = ff_get_buffer ( avctx , frame ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
samples = ( int16_t * ) frame -> data [ 0 ] ;
if ( buf_size < FRAMESIZE ) {
av_log ( avctx , AV_LOG_ERROR , "Frame too small (%d bytes). Truncated file?\n" , buf_size ) ;
* got_frame_ptr = 0 ;
return buf_size ;
}
init_get_bits ( & gb , buf , FRAMESIZE * 8 ) ;
for ( i = 0 ;
i < LPC_ORDER ;
i ++ ) lpc_refl [ i ] = ff_lpc_refl_cb [ i ] [ get_bits ( & gb , sizes [ i ] ) ] ;
ff_eval_coefs ( ractx -> lpc_coef [ 0 ] , lpc_refl ) ;
ractx -> lpc_refl_rms [ 0 ] = ff_rms ( lpc_refl ) ;
energy = ff_energy_tab [ get_bits ( & gb , 5 ) ] ;
refl_rms [ 0 ] = ff_interp ( ractx , block_coefs [ 0 ] , 1 , 1 , ractx -> old_energy ) ;
refl_rms [ 1 ] = ff_interp ( ractx , block_coefs [ 1 ] , 2 , energy <= ractx -> old_energy , ff_t_sqrt ( energy * ractx -> old_energy ) >> 12 ) ;
refl_rms [ 2 ] = ff_interp ( ractx , block_coefs [ 2 ] , 3 , 0 , energy ) ;
refl_rms [ 3 ] = ff_rescale_rms ( ractx -> lpc_refl_rms [ 0 ] , energy ) ;
ff_int_to_int16 ( block_coefs [ 3 ] , ractx -> lpc_coef [ 0 ] ) ;
for ( i = 0 ;
i < NBLOCKS ;
i ++ ) {
do_output_subblock ( ractx , block_coefs [ i ] , refl_rms [ i ] , & gb ) ;
for ( j = 0 ;
j < BLOCKSIZE ;
j ++ ) * samples ++ = av_clip_int16 ( ractx -> curr_sblock [ j + 10 ] << 2 ) ;
}
ractx -> old_energy = energy ;
ractx -> lpc_refl_rms [ 1 ] = ractx -> lpc_refl_rms [ 0 ] ;
FFSWAP ( unsigned int * , ractx -> lpc_coef [ 0 ] , ractx -> lpc_coef [ 1 ] ) ;
* got_frame_ptr = 1 ;
return FRAMESIZE ;
} |
1,742,637,512,846,796,500 | debian | 67 | 0 | static tvbuff_t * mac_is_add_fragment ( tvbuff_t * tvb _U_ , packet_info * pinfo , proto_tree * tree _U_ , guint8 lchid , guint ueid , int offset , guint8 ss , guint16 tsn , int sdu_no , guint8 no_sdus , guint16 maclength ) {
mac_is_channel ch ;
ch . lchid = lchid ;
ch . ueid = ueid ;
if ( pinfo -> fd -> flags . visited == FALSE ) {
body_parts * * body_parts_array = get_body_parts ( & ch ) ;
if ( no_sdus == 1 && ss == 3 ) {
guint head_length , tail_length ;
init_frag ( tvb , body_parts_array [ tsn ] , maclength , offset , pinfo -> num , tsn , MAC_IS_MIDDLE ) ;
tail_length = find_tail ( body_parts_array , tsn ) ;
if ( tail_length > 0 ) {
head_length = find_head ( body_parts_array , & tsn ) ;
if ( head_length > 0 ) {
return reassemble ( tvb , body_parts_array , tsn , tail_length + head_length + maclength , & ch , pinfo -> num ) ;
}
}
}
else if ( sdu_no == 0 && ( ss & 1 ) == 1 ) {
guint length = maclength ;
init_frag ( tvb , body_parts_array [ tsn ] , maclength , offset , pinfo -> num , tsn , MAC_IS_TAIL ) ;
length += find_head ( body_parts_array , & tsn ) ;
if ( length > maclength ) {
return reassemble ( tvb , body_parts_array , tsn , length , & ch , pinfo -> num ) ;
}
}
else if ( sdu_no == no_sdus - 1 && ( ss & 2 ) == 2 ) {
guint length = maclength ;
init_frag ( tvb , body_parts_array [ tsn ] , maclength , offset , pinfo -> num , tsn , MAC_IS_HEAD ) ;
length += find_tail ( body_parts_array , tsn ) ;
if ( length > maclength ) {
return reassemble ( tvb , body_parts_array , tsn , length , & ch , pinfo -> num ) ;
}
}
else {
DISSECTOR_ASSERT ( ( sdu_no == 0 ) ? ( ss & 1 ) == 0 : ( ( sdu_no == no_sdus - 1 ) ? ( ss & 2 ) == 0 : TRUE ) ) ;
return tvb_new_subset ( tvb , offset , maclength , - 1 ) ;
}
}
else {
tvbuff_t * new_tvb = NULL ;
if ( no_sdus == 1 && ss == 3 ) {
mac_is_sdu * sdu = get_sdu ( pinfo -> num , tsn , MAC_IS_MIDDLE , & ch ) ;
if ( sdu ) {
return add_to_tree ( tvb , pinfo , tree , sdu , offset , maclength , MAC_IS_MIDDLE ) ;
}
}
else if ( sdu_no == 0 && ( ss & 1 ) == 1 ) {
mac_is_sdu * sdu = get_sdu ( pinfo -> num , tsn , MAC_IS_TAIL , & ch ) ;
if ( sdu ) {
return add_to_tree ( tvb , pinfo , tree , sdu , offset , maclength , MAC_IS_TAIL ) ;
}
}
else if ( sdu_no == no_sdus - 1 && ( ss & 2 ) == 2 ) {
mac_is_sdu * sdu = get_sdu ( pinfo -> num , tsn , MAC_IS_HEAD , & ch ) ;
if ( sdu ) {
return add_to_tree ( tvb , pinfo , tree , sdu , offset , maclength , MAC_IS_HEAD ) ;
}
}
else {
new_tvb = tvb_new_subset ( tvb , offset , maclength , - 1 ) ;
proto_tree_add_expert ( tree , pinfo , & ei_mac_macis_sdu_complete , new_tvb , 0 , - 1 ) ;
proto_tree_add_item ( tree , hf_mac_edch_type2_sdu_data , new_tvb , 0 , - 1 , ENC_NA ) ;
return new_tvb ;
}
}
return NULL ;
} |
-8,638,406,710,431,929,000 | debian | 13 | 0 | static bfd_boolean srec_new_symbol ( bfd * abfd , const char * name , bfd_vma val ) {
struct srec_symbol * n ;
n = ( struct srec_symbol * ) bfd_alloc ( abfd , sizeof ( * n ) ) ;
if ( n == NULL ) return FALSE ;
n -> name = name ;
n -> val = val ;
if ( abfd -> tdata . srec_data -> symbols == NULL ) abfd -> tdata . srec_data -> symbols = n ;
else abfd -> tdata . srec_data -> symtail -> next = n ;
abfd -> tdata . srec_data -> symtail = n ;
n -> next = NULL ;
++ abfd -> symcount ;
return TRUE ;
} |
6,790,518,433,053,241,000 | debian | 64 | 0 | static gboolean refresh_connections ( gpointer data ) {
struct row_pairs * lastconn = NULL , * cache = NULL ;
GtkTreeModel * model = GTK_TREE_MODEL ( ls_conns ) ;
void * list , * next , * listend ;
struct conn_object * conn ;
GtkTreeIter iter ;
char flags [ 2 ] , status [ 8 ] ;
unsigned int tx = 0 , rx = 0 ;
struct row_pairs * row = NULL , * nextrow = NULL , top , bottom ;
( void ) data ;
memset ( & flags , 0 , sizeof ( flags ) ) ;
memset ( & status , 0 , sizeof ( status ) ) ;
if ( ls_conns ) {
if ( ! gtk_widget_get_visible ( conns_window ) ) return ( FALSE ) ;
}
else {
ls_conns = gtk_list_store_new ( 12 , G_TYPE_STRING , G_TYPE_STRING , G_TYPE_UINT , G_TYPE_STRING , G_TYPE_STRING , G_TYPE_UINT , G_TYPE_STRING , G_TYPE_STRING , G_TYPE_UINT , G_TYPE_UINT , G_TYPE_STRING , G_TYPE_POINTER ) ;
connections = NULL ;
}
for ( row = connections ;
row ;
row = nextrow ) {
nextrow = row -> next ;
if ( conntrack_get ( 0 , row -> conn , NULL ) == NULL ) {
gtk_list_store_remove ( GTK_LIST_STORE ( ls_conns ) , & row -> iter ) ;
if ( row -> next ) row -> next -> prev = row -> prev ;
if ( row -> prev ) row -> prev -> next = row -> next ;
else connections = row -> next ;
SAFE_FREE ( row ) ;
}
if ( row ) lastconn = row ;
}
if ( ! lastconn ) {
listend = conntrack_get ( 0 , NULL , NULL ) ;
if ( listend == NULL ) return ( TRUE ) ;
}
else {
listend = lastconn -> conn ;
}
for ( list = conntrack_get ( + 1 , listend , NULL ) ;
list ;
list = next ) {
next = conntrack_get ( + 1 , list , & conn ) ;
cache = gtkui_connections_add ( conn , list , & connections ) ;
if ( cache ) lastconn = cache ;
}
gtkui_connection_list_row ( 1 , & top ) ;
gtkui_connection_list_row ( 0 , & bottom ) ;
if ( top . conn == NULL ) return ( TRUE ) ;
iter = top . iter ;
do {
gtk_tree_model_get ( model , & iter , 11 , & list , - 1 ) ;
conntrack_get ( 0 , list , & conn ) ;
conntrack_flagstr ( conn , flags , sizeof ( flags ) ) ;
conntrack_statusstr ( conn , status , sizeof ( status ) ) ;
tx = conn -> tx ;
rx = conn -> rx ;
gtk_list_store_set ( ls_conns , & iter , 0 , flags , 7 , status , 8 , tx , 9 , rx , - 1 ) ;
if ( bottom . conn == list ) break ;
}
while ( gtk_tree_model_iter_next ( model , & iter ) ) ;
gtk_tree_model_filter_refilter ( GTK_TREE_MODEL_FILTER ( filter . model ) ) ;
return ( TRUE ) ;
} |
-3,725,939,782,329,394,000 | debian | 20 | 0 | static tmsize_t _tiffWriteProc ( thandle_t fd , void * buf , tmsize_t size ) {
uint8 * ma ;
uint64 mb ;
DWORD n ;
DWORD o ;
tmsize_t p ;
ma = ( uint8 * ) buf ;
mb = size ;
p = 0 ;
while ( mb > 0 ) {
n = 0x80000000UL ;
if ( ( uint64 ) n > mb ) n = ( DWORD ) mb ;
if ( ! WriteFile ( fd , ( LPVOID ) ma , n , & o , NULL ) ) return ( 0 ) ;
ma += o ;
mb -= o ;
p += o ;
if ( o != n ) break ;
}
return ( p ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_VBDMode ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_VBDMode , VBDMode_sequence ) ;
return offset ;
} |
-5,280,794,106,681,745,000 | debian | 7 | 0 | static void gst_asf_demux_check_segment_ts ( GstASFDemux * demux , GstClockTime payload_ts ) {
if ( G_UNLIKELY ( ! GST_CLOCK_TIME_IS_VALID ( demux -> segment_ts ) && GST_CLOCK_TIME_IS_VALID ( demux -> first_ts ) ) ) {
GST_DEBUG_OBJECT ( demux , "segment ts: %" GST_TIME_FORMAT , GST_TIME_ARGS ( demux -> first_ts ) ) ;
demux -> segment_ts = payload_ts ;
if ( demux -> streaming ) gst_segment_do_seek ( & demux -> segment , demux -> in_segment . rate , GST_FORMAT_TIME , ( GstSeekFlags ) demux -> segment . flags , GST_SEEK_TYPE_SET , demux -> segment_ts , GST_SEEK_TYPE_NONE , 0 , NULL ) ;
}
} |
3,584,320,764,213,684,000 | debian | 36 | 1 | int parse_RANGEBOUNDARY ( tvbuff_t * tvb , int offset , proto_tree * parent_tree , proto_tree * pad_tree , const char * fmt , ... ) {
guint32 ulType ;
guint8 labelPresent ;
proto_item * item ;
proto_tree * tree ;
const char * txt ;
struct CBaseStorageVariant prval ;
va_list ap ;
va_start ( ap , fmt ) ;
txt = wmem_strdup_vprintf ( wmem_packet_scope ( ) , fmt , ap ) ;
va_end ( ap ) ;
tree = proto_tree_add_subtree ( parent_tree , tvb , offset , 0 , ett_RANGEBOUNDARY , & item , txt ) ;
ulType = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_item ( tree , hf_mswsp_rangeboundry_ultype , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
proto_item_append_text ( item , ": Type 0x%08x" , ulType ) ;
offset += 4 ;
ZERO_STRUCT ( prval ) ;
offset = parse_CBaseStorageVariant ( tvb , offset , tree , pad_tree , & prval , "prVal" ) ;
labelPresent = tvb_get_guint8 ( tvb , offset ) ;
proto_tree_add_item ( tree , hf_mswsp_rangeboundry_labelpresent , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset += 1 ;
if ( labelPresent ) {
guint32 ccLabel ;
const guint8 * label ;
offset = parse_padding ( tvb , offset , 4 , pad_tree , "paddingLabelPresent" ) ;
ccLabel = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_item_ret_uint ( tree , hf_mswsp_rangeboundry_cclabel , tvb , offset , 4 , ENC_LITTLE_ENDIAN , & ccLabel ) ;
offset += 4 ;
proto_tree_add_item_ret_string ( tree , hf_mswsp_rangeboundry_label , tvb , offset , 2 * ccLabel , ENC_LITTLE_ENDIAN | ENC_UCS_2 , wmem_packet_scope ( ) , & label ) ;
proto_item_append_text ( item , " Label: \"%s\"" , label ) ;
offset += 2 * ccLabel ;
}
proto_item_append_text ( item , " Val: %s" , str_CBaseStorageVariant ( & prval , TRUE ) ) ;
proto_item_set_end ( item , tvb , offset ) ;
return offset ;
} |
-2,915,908,172,644,761,000 | debian | 41 | 0 | static int decode_cdlms ( WmallDecodeCtx * s ) {
int c , i ;
int cdlms_send_coef = get_bits1 ( & s -> gb ) ;
for ( c = 0 ;
c < s -> num_channels ;
c ++ ) {
s -> cdlms_ttl [ c ] = get_bits ( & s -> gb , 3 ) + 1 ;
for ( i = 0 ;
i < s -> cdlms_ttl [ c ] ;
i ++ ) {
s -> cdlms [ c ] [ i ] . order = ( get_bits ( & s -> gb , 7 ) + 1 ) * 8 ;
if ( s -> cdlms [ c ] [ i ] . order > MAX_ORDER ) {
av_log ( s -> avctx , AV_LOG_ERROR , "Order[%d][%d] %d > max (%d), not supported\n" , c , i , s -> cdlms [ c ] [ i ] . order , MAX_ORDER ) ;
s -> cdlms [ 0 ] [ 0 ] . order = 0 ;
return AVERROR_INVALIDDATA ;
}
}
for ( i = 0 ;
i < s -> cdlms_ttl [ c ] ;
i ++ ) s -> cdlms [ c ] [ i ] . scaling = get_bits ( & s -> gb , 4 ) ;
if ( cdlms_send_coef ) {
for ( i = 0 ;
i < s -> cdlms_ttl [ c ] ;
i ++ ) {
int cbits , shift_l , shift_r , j ;
cbits = av_log2 ( s -> cdlms [ c ] [ i ] . order ) ;
if ( ( 1 << cbits ) < s -> cdlms [ c ] [ i ] . order ) cbits ++ ;
s -> cdlms [ c ] [ i ] . coefsend = get_bits ( & s -> gb , cbits ) + 1 ;
cbits = av_log2 ( s -> cdlms [ c ] [ i ] . scaling + 1 ) ;
if ( ( 1 << cbits ) < s -> cdlms [ c ] [ i ] . scaling + 1 ) cbits ++ ;
s -> cdlms [ c ] [ i ] . bitsend = get_bits ( & s -> gb , cbits ) + 2 ;
shift_l = 32 - s -> cdlms [ c ] [ i ] . bitsend ;
shift_r = 32 - s -> cdlms [ c ] [ i ] . scaling - 2 ;
for ( j = 0 ;
j < s -> cdlms [ c ] [ i ] . coefsend ;
j ++ ) s -> cdlms [ c ] [ i ] . coefs [ j ] = ( get_bits ( & s -> gb , s -> cdlms [ c ] [ i ] . bitsend ) << shift_l ) >> shift_r ;
}
}
}
return 0 ;
} |
-7,334,302,271,653,595,000 | debian | 5 | 0 | static bool left_is_superset ( DTCollation * left , DTCollation * right ) {
if ( left -> collation -> state & MY_CS_UNICODE && ( left -> derivation < right -> derivation || ( left -> derivation == right -> derivation && ( ! ( right -> collation -> state & MY_CS_UNICODE ) || ( left -> collation -> state & MY_CS_UNICODE_SUPPLEMENT && ! ( right -> collation -> state & MY_CS_UNICODE_SUPPLEMENT ) && left -> collation -> mbmaxlen > right -> collation -> mbmaxlen && left -> collation -> mbminlen == right -> collation -> mbminlen ) ) ) ) ) return TRUE ;
if ( right -> repertoire == MY_REPERTOIRE_ASCII && ( left -> derivation < right -> derivation || ( left -> derivation == right -> derivation && ! ( left -> repertoire == MY_REPERTOIRE_ASCII ) ) ) ) return TRUE ;
return FALSE ;
} |
-7,455,544,248,455,991,000 | debian | 3 | 0 | void kvm_arch_remove_all_hw_breakpoints ( void ) {
nb_hw_breakpoint = 0 ;
} |
-3,740,862,514,502,467,000 | debian | 86 | 0 | static void dumpcomposite ( SplineChar * sc , struct glyphinfo * gi ) {
struct glyphhead gh ;
DBounds bb ;
int i , ptcnt , ctcnt , flags , sptcnt , rd ;
SplineSet * ss ;
RefChar * ref ;
SplineChar * isc = sc -> ttf_instrs == NULL && sc -> parent -> mm != NULL && sc -> parent -> mm -> apple ? sc -> parent -> mm -> normal -> glyphs [ sc -> orig_pos ] : sc ;
int arg1 , arg2 ;
if ( gi -> next_glyph != sc -> ttf_glyph ) IError ( "Glyph count wrong in ttf output" ) ;
if ( gi -> next_glyph >= gi -> maxp -> numGlyphs ) IError ( "max glyph count wrong in ttf output" ) ;
gi -> loca [ gi -> next_glyph ] = ftell ( gi -> glyphs ) ;
SplineCharLayerQuickBounds ( sc , gi -> layer , & bb ) ;
gh . numContours = - 1 ;
gh . xmin = floor ( bb . minx ) ;
gh . ymin = floor ( bb . miny ) ;
gh . xmax = ceil ( bb . maxx ) ;
gh . ymax = ceil ( bb . maxy ) ;
dumpghstruct ( gi , & gh ) ;
i = ptcnt = ctcnt = 0 ;
for ( ref = sc -> layers [ gi -> layer ] . refs ;
ref != NULL ;
ref = ref -> next , ++ i ) {
if ( ref -> sc -> ttf_glyph == - 1 ) {
continue ;
}
flags = 0 ;
if ( ref -> round_translation_to_grid ) flags |= _ROUND ;
if ( ref -> use_my_metrics ) flags |= _USE_MY_METRICS ;
if ( ref -> next != NULL ) flags |= _MORE ;
else if ( isc -> ttf_instrs_len != 0 ) flags |= _INSTR ;
if ( ref -> transform [ 1 ] != 0 || ref -> transform [ 2 ] != 0 ) flags |= _MATRIX ;
else if ( ref -> transform [ 0 ] != ref -> transform [ 3 ] ) flags |= _XY_SCALE ;
else if ( ref -> transform [ 0 ] != 1. ) flags |= _SCALE ;
if ( ref -> point_match ) {
arg1 = ref -> match_pt_base ;
arg2 = ref -> match_pt_ref ;
}
else {
arg1 = rint ( ref -> transform [ 4 ] ) ;
arg2 = rint ( ref -> transform [ 5 ] ) ;
flags |= _ARGS_ARE_XY | _UNSCALED_OFFSETS ;
}
if ( arg1 < - 128 || arg1 > 127 || arg2 < - 128 || arg2 > 127 ) flags |= _ARGS_ARE_WORDS ;
putshort ( gi -> glyphs , flags ) ;
putshort ( gi -> glyphs , ref -> sc -> ttf_glyph == - 1 ? 0 : ref -> sc -> ttf_glyph ) ;
if ( flags & _ARGS_ARE_WORDS ) {
putshort ( gi -> glyphs , ( short ) arg1 ) ;
putshort ( gi -> glyphs , ( short ) arg2 ) ;
}
else {
putc ( ( char ) arg1 , gi -> glyphs ) ;
putc ( ( char ) arg2 , gi -> glyphs ) ;
}
if ( flags & _MATRIX ) {
put2d14 ( gi -> glyphs , ref -> transform [ 0 ] ) ;
put2d14 ( gi -> glyphs , ref -> transform [ 1 ] ) ;
put2d14 ( gi -> glyphs , ref -> transform [ 2 ] ) ;
put2d14 ( gi -> glyphs , ref -> transform [ 3 ] ) ;
}
else if ( flags & _XY_SCALE ) {
put2d14 ( gi -> glyphs , ref -> transform [ 0 ] ) ;
put2d14 ( gi -> glyphs , ref -> transform [ 3 ] ) ;
}
else if ( flags & _SCALE ) {
put2d14 ( gi -> glyphs , ref -> transform [ 0 ] ) ;
}
sptcnt = SSTtfNumberPoints ( ref -> layers [ 0 ] . splines ) ;
for ( ss = ref -> layers [ 0 ] . splines ;
ss != NULL ;
ss = ss -> next ) {
++ ctcnt ;
}
if ( sc -> layers [ gi -> layer ] . order2 ) ptcnt += sptcnt ;
else if ( ptcnt >= 0 && gi -> pointcounts [ ref -> sc -> ttf_glyph == - 1 ? 0 : ref -> sc -> ttf_glyph ] >= 0 ) ptcnt += gi -> pointcounts [ ref -> sc -> ttf_glyph == - 1 ? 0 : ref -> sc -> ttf_glyph ] ;
else ptcnt = - 1 ;
rd = RefDepth ( ref , gi -> layer ) ;
if ( rd > gi -> maxp -> maxcomponentdepth ) gi -> maxp -> maxcomponentdepth = rd ;
}
if ( isc -> ttf_instrs_len != 0 ) dumpinstrs ( gi , isc -> ttf_instrs , isc -> ttf_instrs_len ) ;
gi -> pointcounts [ gi -> next_glyph ++ ] = ptcnt ;
if ( gi -> maxp -> maxnumcomponents < i ) gi -> maxp -> maxnumcomponents = i ;
if ( gi -> maxp -> maxCompositPts < ptcnt ) gi -> maxp -> maxCompositPts = ptcnt ;
if ( gi -> maxp -> maxCompositCtrs < ctcnt ) gi -> maxp -> maxCompositCtrs = ctcnt ;
ttfdumpmetrics ( sc , gi , & bb ) ;
if ( ftell ( gi -> glyphs ) & 1 ) putc ( '\0' , gi -> glyphs ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_T_mode_rfc2733diffport ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_T_mode_rfc2733diffport , T_mode_rfc2733diffport_sequence ) ;
return offset ;
} |
6,790,518,433,053,241,000 | debian | 47 | 0 | static void gtkui_connection_inject_file ( void ) {
GtkWidget * dialog , * label , * vbox , * hbox , * content_area ;
GtkWidget * button1 , * button2 , * button , * entry ;
char tmp [ MAX_ASCII_ADDR_LEN ] ;
const char * filename = NULL ;
gint response = 0 ;
DEBUG_MSG ( "gtk_connection_inject_file" ) ;
if ( curr_conn == NULL ) return ;
dialog = gtk_dialog_new_with_buttons ( "Character Injection" , GTK_WINDOW ( window ) , GTK_DIALOG_MODAL , GTK_STOCK_CANCEL , GTK_RESPONSE_CANCEL , GTK_STOCK_OK , GTK_RESPONSE_OK , NULL ) ;
gtk_window_set_default_size ( GTK_WINDOW ( dialog ) , 400 , 150 ) ;
# if ! GTK_CHECK_VERSION ( 2 , 22 , 0 ) gtk_dialog_set_has_separator ( GTK_DIALOG ( dialog ) , FALSE ) ;
# endif gtk_container_set_border_width ( GTK_CONTAINER ( dialog ) , 5 ) ;
content_area = gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) ) ;
vbox = gtkui_box_new ( GTK_ORIENTATION_VERTICAL , 0 , FALSE ) ;
gtk_box_pack_start ( GTK_BOX ( content_area ) , vbox , FALSE , FALSE , 0 ) ;
label = gtk_label_new ( "Packet destination:" ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0 , 0.5 ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , label , FALSE , FALSE , 0 ) ;
hbox = gtkui_box_new ( GTK_ORIENTATION_HORIZONTAL , 5 , FALSE ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , hbox , FALSE , FALSE , 0 ) ;
button1 = gtk_radio_button_new_with_label ( NULL , ip_addr_ntoa ( & curr_conn -> L3_addr2 , tmp ) ) ;
gtk_box_pack_start ( GTK_BOX ( hbox ) , button1 , FALSE , FALSE , 0 ) ;
gtk_widget_show ( button1 ) ;
button2 = gtk_radio_button_new_with_label_from_widget ( GTK_RADIO_BUTTON ( button1 ) , ip_addr_ntoa ( & curr_conn -> L3_addr1 , tmp ) ) ;
gtk_box_pack_start ( GTK_BOX ( hbox ) , button2 , FALSE , FALSE , 0 ) ;
label = gtk_label_new ( "File to inject:" ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0 , 0.5 ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , label , FALSE , FALSE , 0 ) ;
hbox = gtkui_box_new ( GTK_ORIENTATION_HORIZONTAL , 5 , FALSE ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , hbox , FALSE , FALSE , 0 ) ;
entry = gtk_entry_new ( ) ;
gtk_box_pack_start ( GTK_BOX ( hbox ) , entry , TRUE , TRUE , 0 ) ;
button = gtk_button_new_with_label ( "..." ) ;
gtk_box_pack_start ( GTK_BOX ( hbox ) , button , FALSE , FALSE , 0 ) ;
g_signal_connect ( G_OBJECT ( button ) , "clicked" , G_CALLBACK ( gtkui_filename_browse ) , entry ) ;
gtk_widget_show_all ( dialog ) ;
response = gtk_dialog_run ( GTK_DIALOG ( dialog ) ) ;
if ( response == GTK_RESPONSE_OK ) {
gtk_widget_hide ( dialog ) ;
filename = gtk_entry_get_text ( GTK_ENTRY ( entry ) ) ;
if ( filename && strlen ( filename ) > 0 ) {
if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button1 ) ) ) gtkui_inject_file ( filename , 1 ) ;
else if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button2 ) ) ) gtkui_inject_file ( filename , 2 ) ;
}
}
gtk_widget_destroy ( dialog ) ;
} |
1,339,575,514,457,462,500 | chrome | 6 | 0 | TEST_F ( IconLabelBubbleViewTest , AnimateLayout ) {
VerifyWithAnimationStep ( 1 ) ;
VerifyWithAnimationStep ( 5 ) ;
VerifyWithAnimationStep ( 10 ) ;
VerifyWithAnimationStep ( 25 ) ;
} |
4,511,225,370,772,574,700 | debian | 231 | 0 | int uwsgi_php_request ( struct wsgi_request * wsgi_req ) {
char real_filename [ PATH_MAX + 1 ] ;
char * path_info = NULL ;
size_t real_filename_len = 0 ;
struct stat php_stat ;
char * filename = NULL ;
int force_empty_script_name = 0 ;
zend_file_handle file_handle ;
# ifdef ZTS TSRMLS_FETCH ( ) ;
# endif SG ( server_context ) = ( void * ) wsgi_req ;
if ( uwsgi_parse_vars ( wsgi_req ) ) {
return - 1 ;
}
char * orig_path_info = wsgi_req -> path_info ;
uint16_t orig_path_info_len = wsgi_req -> path_info_len ;
if ( uphp . docroot ) {
wsgi_req -> document_root = uphp . docroot ;
}
else if ( ! wsgi_req -> document_root_len ) {
wsgi_req -> document_root = uwsgi . cwd ;
}
else {
char * sanitized_docroot = ecalloc ( 1 , PATH_MAX + 1 ) ;
if ( ! uwsgi_expand_path ( wsgi_req -> document_root , wsgi_req -> document_root_len , sanitized_docroot ) ) {
efree ( sanitized_docroot ) ;
return - 1 ;
}
wsgi_req -> document_root = sanitized_docroot ;
}
wsgi_req -> document_root_len = strlen ( wsgi_req -> document_root ) ;
if ( uphp . app ) {
# ifdef UWSGI_PCRE struct uwsgi_regexp_list * bypass = uphp . app_bypass ;
while ( bypass ) {
if ( uwsgi_regexp_match ( bypass -> pattern , bypass -> pattern_extra , wsgi_req -> uri , wsgi_req -> uri_len ) >= 0 ) {
goto oldstyle ;
}
bypass = bypass -> next ;
}
# endif strcpy ( real_filename , uphp . app ) ;
if ( wsgi_req -> path_info_len == 1 && wsgi_req -> path_info [ 0 ] == '/' ) {
goto appready ;
}
if ( uphp . app_qs ) {
size_t app_qs_len = strlen ( uphp . app_qs ) ;
size_t qs_len = wsgi_req -> path_info_len + app_qs_len ;
if ( wsgi_req -> query_string_len > 0 ) {
qs_len += 1 + wsgi_req -> query_string_len ;
}
char * qs = ecalloc ( 1 , qs_len + 1 ) ;
memcpy ( qs , uphp . app_qs , app_qs_len ) ;
memcpy ( qs + app_qs_len , wsgi_req -> path_info , wsgi_req -> path_info_len ) ;
if ( wsgi_req -> query_string_len > 0 ) {
char * ptr = qs + app_qs_len + wsgi_req -> path_info_len ;
* ptr = '&' ;
memcpy ( ptr + 1 , wsgi_req -> query_string , wsgi_req -> query_string_len ) ;
}
wsgi_req -> query_string = qs ;
wsgi_req -> query_string_len = qs_len ;
}
appready : wsgi_req -> path_info = "" ;
wsgi_req -> path_info_len = 0 ;
force_empty_script_name = 1 ;
goto secure2 ;
}
# ifdef UWSGI_PCRE oldstyle : # endif filename = uwsgi_concat4n ( wsgi_req -> document_root , wsgi_req -> document_root_len , "/" , 1 , wsgi_req -> path_info , wsgi_req -> path_info_len , "" , 0 ) ;
if ( uwsgi_php_walk ( wsgi_req , filename , wsgi_req -> document_root , wsgi_req -> document_root_len , & path_info ) ) {
free ( filename ) ;
if ( uphp . fallback || uphp . fallback2 ) {
if ( uphp . fallback ) {
filename = uwsgi_str ( uphp . fallback ) ;
}
else {
filename = uwsgi_concat2n ( wsgi_req -> document_root , strlen ( wsgi_req -> document_root ) , uphp . fallback2 , strlen ( uphp . fallback2 ) ) ;
wsgi_req -> script_name = uphp . fallback2 ;
wsgi_req -> script_name_len = strlen ( uphp . fallback2 ) ;
}
if ( uphp . fallback_qs ) {
size_t fqs_len = strlen ( uphp . fallback_qs ) ;
size_t new_qs_len = orig_path_info_len + fqs_len + 1 + wsgi_req -> query_string_len ;
char * new_qs = ecalloc ( 1 , new_qs_len + 1 ) ;
memcpy ( new_qs , uphp . fallback_qs , fqs_len ) ;
new_qs [ fqs_len ] = '=' ;
memcpy ( new_qs + fqs_len + 1 , orig_path_info , orig_path_info_len ) ;
if ( wsgi_req -> query_string_len ) {
new_qs [ fqs_len + 1 + orig_path_info_len ] = '&' ;
memcpy ( new_qs + fqs_len + 2 + orig_path_info_len , wsgi_req -> query_string , wsgi_req -> query_string_len ) ;
}
wsgi_req -> query_string = new_qs ;
wsgi_req -> query_string_len = new_qs_len ;
}
}
else {
uwsgi_404 ( wsgi_req ) ;
return - 1 ;
}
}
if ( path_info ) {
wsgi_req -> path_info = path_info ;
wsgi_req -> path_info_len = orig_path_info_len - ( path_info - orig_path_info ) ;
}
else {
wsgi_req -> path_info = "" ;
wsgi_req -> path_info_len = 0 ;
}
if ( ! realpath ( filename , real_filename ) ) {
free ( filename ) ;
uwsgi_404 ( wsgi_req ) ;
return - 1 ;
}
free ( filename ) ;
real_filename_len = strlen ( real_filename ) ;
if ( uphp . allowed_docroot ) {
struct uwsgi_string_list * usl = uphp . allowed_docroot ;
while ( usl ) {
if ( ! uwsgi_starts_with ( real_filename , real_filename_len , usl -> value , usl -> len ) ) {
goto secure ;
}
usl = usl -> next ;
}
uwsgi_403 ( wsgi_req ) ;
uwsgi_log ( "PHP security error: %s is not under an allowed docroot\n" , real_filename ) ;
return - 1 ;
}
else if ( uphp . docroot ) {
if ( ! uwsgi_starts_with ( real_filename , real_filename_len , uphp . docroot , uphp . docroot_len ) ) {
goto secure ;
}
uwsgi_403 ( wsgi_req ) ;
uwsgi_log ( "PHP security error: %s is not under the default docroot\n" , real_filename ) ;
return - 1 ;
}
secure : if ( stat ( real_filename , & php_stat ) ) {
uwsgi_404 ( wsgi_req ) ;
return UWSGI_OK ;
}
if ( S_ISDIR ( php_stat . st_mode ) ) {
if ( orig_path_info_len == 0 || ( orig_path_info_len > 0 && orig_path_info [ orig_path_info_len - 1 ] != '/' ) ) {
wsgi_req -> path_info = orig_path_info ;
wsgi_req -> path_info_len = orig_path_info_len ;
uwsgi_redirect_to_slash ( wsgi_req ) ;
return UWSGI_OK ;
}
struct uwsgi_string_list * upi = uphp . index ;
real_filename [ real_filename_len ] = '/' ;
real_filename_len ++ ;
int found = 0 ;
while ( upi ) {
if ( real_filename_len + upi -> len + 1 < PATH_MAX ) {
memcpy ( real_filename + real_filename_len , upi -> value , upi -> len + 1 ) ;
if ( ! access ( real_filename , R_OK ) ) {
found = 1 ;
break ;
}
}
upi = upi -> next ;
}
if ( ! found ) {
uwsgi_404 ( wsgi_req ) ;
return UWSGI_OK ;
}
real_filename_len = strlen ( real_filename ) ;
}
if ( uphp . allowed_ext ) {
struct uwsgi_string_list * usl = uphp . allowed_ext ;
while ( usl ) {
if ( real_filename_len >= usl -> len ) {
if ( ! uwsgi_strncmp ( real_filename + ( real_filename_len - usl -> len ) , usl -> len , usl -> value , usl -> len ) ) {
goto secure2 ;
}
}
usl = usl -> next ;
}
uwsgi_403 ( wsgi_req ) ;
uwsgi_log ( "PHP security error: %s does not end with an allowed extension\n" , real_filename ) ;
return - 1 ;
}
secure2 : wsgi_req -> file = real_filename ;
wsgi_req -> file_len = strlen ( wsgi_req -> file ) ;
if ( uphp . allowed_scripts ) {
struct uwsgi_string_list * usl = uphp . allowed_scripts ;
while ( usl ) {
if ( ! uwsgi_strncmp ( wsgi_req -> file , wsgi_req -> file_len , usl -> value , usl -> len ) ) {
goto secure3 ;
}
usl = usl -> next ;
}
uwsgi_403 ( wsgi_req ) ;
uwsgi_log ( "PHP security error: %s is not an allowed script\n" , real_filename ) ;
return - 1 ;
}
secure3 : if ( force_empty_script_name ) {
wsgi_req -> script_name = "" ;
wsgi_req -> script_name_len = 0 ;
}
else if ( ! uphp . fallback2 ) {
wsgi_req -> script_name = orig_path_info ;
if ( path_info ) {
wsgi_req -> script_name_len = path_info - orig_path_info ;
}
else {
wsgi_req -> script_name_len = orig_path_info_len ;
}
}
# ifdef UWSGI_DEBUG uwsgi_log ( "php filename = %s script_name = %.*s (%d) document_root = %.*s (%d)\n" , real_filename , wsgi_req -> script_name_len , wsgi_req -> script_name , wsgi_req -> script_name_len , wsgi_req -> document_root_len , wsgi_req -> document_root , wsgi_req -> document_root_len ) ;
# endif SG ( request_info ) . request_uri = estrndup ( wsgi_req -> uri , wsgi_req -> uri_len ) ;
SG ( request_info ) . request_method = estrndup ( wsgi_req -> method , wsgi_req -> method_len ) ;
SG ( request_info ) . proto_num = 1001 ;
SG ( request_info ) . query_string = estrndup ( wsgi_req -> query_string , wsgi_req -> query_string_len ) ;
SG ( request_info ) . content_length = wsgi_req -> post_cl ;
SG ( request_info ) . content_type = estrndup ( wsgi_req -> content_type , wsgi_req -> content_type_len ) ;
SG ( sapi_headers ) . http_response_code = 200 ;
SG ( request_info ) . path_translated = wsgi_req -> file ;
file_handle . type = ZEND_HANDLE_FILENAME ;
file_handle . filename = real_filename ;
file_handle . free_filename = 0 ;
file_handle . opened_path = NULL ;
if ( php_request_startup ( TSRMLS_C ) == FAILURE ) {
uwsgi_500 ( wsgi_req ) ;
return - 1 ;
}
struct uwsgi_string_list * usl = NULL ;
uwsgi_foreach ( usl , uphp . exec_before ) {
if ( zend_eval_string_ex ( usl -> value , NULL , "uWSGI php exec before" , 1 TSRMLS_CC ) == FAILURE ) goto end ;
}
php_execute_script ( & file_handle TSRMLS_CC ) ;
uwsgi_foreach ( usl , uphp . exec_after ) {
if ( zend_eval_string_ex ( usl -> value , NULL , "uWSGI php exec after" , 1 TSRMLS_CC ) == FAILURE ) goto end ;
}
end : php_request_shutdown ( NULL ) ;
return 0 ;
} |
6,336,384,260,629,386,000 | debian | 14 | 0 | static void dissect_zcl_pwr_prof_pwrprofstatersp ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
proto_tree * sub_tree = NULL ;
guint i ;
guint8 power_profile_count ;
power_profile_count = MIN ( tvb_get_guint8 ( tvb , * offset ) , ZBEE_ZCL_PWR_PROF_NUM_PWR_PROF_ETT ) ;
proto_tree_add_item ( tree , hf_zbee_zcl_pwr_prof_pwr_prof_count , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
for ( i = 0 ;
i < power_profile_count ;
i ++ ) {
sub_tree = proto_tree_add_subtree_format ( tree , tvb , * offset , 1 , ett_zbee_zcl_pwr_prof_pwrprofiles [ i ] , NULL , "Power Profile #%u" , i ) ;
dissect_zcl_power_profile ( tvb , sub_tree , offset ) ;
}
} |
-2,964,264,153,308,487,700 | debian | 45 | 0 | static MagickBooleanType load_tile ( Image * image , Image * tile_image , XCFDocInfo * inDocInfo , XCFLayerInfo * inLayerInfo , size_t data_length , ExceptionInfo * exception ) {
ssize_t y ;
register ssize_t x ;
register Quantum * q ;
ssize_t count ;
unsigned char * graydata ;
XCFPixelInfo * xcfdata , * xcfodata ;
xcfdata = ( XCFPixelInfo * ) AcquireQuantumMemory ( MagickMax ( data_length , tile_image -> columns * tile_image -> rows ) , sizeof ( * xcfdata ) ) ;
if ( xcfdata == ( XCFPixelInfo * ) NULL ) ThrowBinaryException ( ResourceLimitError , "MemoryAllocationFailed" , image -> filename ) ;
xcfodata = xcfdata ;
graydata = ( unsigned char * ) xcfdata ;
count = ReadBlob ( image , data_length , ( unsigned char * ) xcfdata ) ;
if ( count != ( ssize_t ) data_length ) ThrowBinaryException ( CorruptImageError , "NotEnoughPixelData" , image -> filename ) ;
for ( y = 0 ;
y < ( ssize_t ) tile_image -> rows ;
y ++ ) {
q = GetAuthenticPixels ( tile_image , 0 , y , tile_image -> columns , 1 , exception ) ;
if ( q == ( Quantum * ) NULL ) break ;
if ( inDocInfo -> image_type == GIMP_GRAY ) {
for ( x = 0 ;
x < ( ssize_t ) tile_image -> columns ;
x ++ ) {
SetPixelGray ( tile_image , ScaleCharToQuantum ( * graydata ) , q ) ;
SetPixelAlpha ( tile_image , ScaleCharToQuantum ( ( unsigned char ) inLayerInfo -> alpha ) , q ) ;
graydata ++ ;
q += GetPixelChannels ( tile_image ) ;
}
}
else if ( inDocInfo -> image_type == GIMP_RGB ) {
for ( x = 0 ;
x < ( ssize_t ) tile_image -> columns ;
x ++ ) {
SetPixelRed ( tile_image , ScaleCharToQuantum ( xcfdata -> red ) , q ) ;
SetPixelGreen ( tile_image , ScaleCharToQuantum ( xcfdata -> green ) , q ) ;
SetPixelBlue ( tile_image , ScaleCharToQuantum ( xcfdata -> blue ) , q ) ;
SetPixelAlpha ( tile_image , xcfdata -> alpha == 255U ? TransparentAlpha : ScaleCharToQuantum ( ( unsigned char ) inLayerInfo -> alpha ) , q ) ;
xcfdata ++ ;
q += GetPixelChannels ( tile_image ) ;
}
}
if ( SyncAuthenticPixels ( tile_image , exception ) == MagickFalse ) break ;
}
xcfodata = ( XCFPixelInfo * ) RelinquishMagickMemory ( xcfodata ) ;
return MagickTrue ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_INTEGER_0_16 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 0U , 16U , NULL , FALSE ) ;
return offset ;
} |
-3,502,382,902,740,740,600 | debian | 14 | 0 | static char * alnumerize ( char * name ) {
char * r = name ;
char * w = name ;
char c ;
for ( ;
( c = * r ) ;
r ++ ) {
if ( g_ascii_isalnum ( c ) || c == '_' || c == '-' || c == '.' ) {
* ( w ++ ) = c ;
}
}
* w = '\0' ;
return name ;
} |
-7,117,046,864,335,130,000 | chrome | 15 | 0 | static int get_active_quality ( int q , int gfu_boost , int low , int high , int * low_motion_minq , int * high_motion_minq ) {
if ( gfu_boost > high ) {
return low_motion_minq [ q ] ;
}
else if ( gfu_boost < low ) {
return high_motion_minq [ q ] ;
}
else {
const int gap = high - low ;
const int offset = high - gfu_boost ;
const int qdiff = high_motion_minq [ q ] - low_motion_minq [ q ] ;
const int adjustment = ( ( offset * qdiff ) + ( gap >> 1 ) ) / gap ;
return low_motion_minq [ q ] + adjustment ;
}
} |
5,357,882,892,791,796,000 | debian | 18 | 0 | static void e1000e_intrmgr_fire_all_timers ( E1000ECore * core ) {
int i ;
uint32_t val = e1000e_intmgr_collect_delayed_causes ( core ) ;
trace_e1000e_irq_adding_delayed_causes ( val , core -> mac [ ICR ] ) ;
core -> mac [ ICR ] |= val ;
if ( core -> itr . running ) {
timer_del ( core -> itr . timer ) ;
e1000e_intrmgr_on_throttling_timer ( & core -> itr ) ;
}
for ( i = 0 ;
i < E1000E_MSIX_VEC_NUM ;
i ++ ) {
if ( core -> eitr [ i ] . running ) {
timer_del ( core -> eitr [ i ] . timer ) ;
e1000e_intrmgr_on_msix_throttling_timer ( & core -> eitr [ i ] ) ;
}
}
} |
373,200,843,854,506,750 | chrome | 38 | 0 | static int32_t prepareFromUMappings ( UCMTable * table ) {
UCMapping * mappings , * m ;
int32_t * map ;
int32_t i , j , count ;
int8_t flag ;
mappings = table -> mappings ;
map = table -> reverseMap ;
count = table -> mappingsLength ;
m = mappings ;
for ( i = j = 0 ;
i < count ;
++ m , ++ i ) {
flag = m -> f ;
if ( flag >= 0 ) {
flag &= MBCS_FROM_U_EXT_MASK ;
m -> f = flag ;
}
if ( flag == 0 || flag == 1 || ( flag == 2 && m -> bLen == 1 ) || flag == 4 ) {
map [ j ++ ] = i ;
if ( m -> uLen > 1 ) {
UChar32 * u32 ;
UChar * u ;
UChar32 c ;
int32_t q , r ;
u32 = UCM_GET_CODE_POINTS ( table , m ) ;
u = ( UChar * ) u32 ;
for ( r = 2 , q = 1 ;
q < m -> uLen ;
++ q ) {
c = u32 [ q ] ;
U16_APPEND_UNSAFE ( u , r , c ) ;
}
m -> uLen = ( int8_t ) r ;
}
}
}
return j ;
} |
-6,474,315,190,511,670,000 | debian | 7 | 0 | static gcry_mpi_t hex2mpi ( const char * string ) {
gpg_error_t err ;
gcry_mpi_t val ;
err = gcry_mpi_scan ( & val , GCRYMPI_FMT_HEX , string , 0 , NULL ) ;
if ( err ) die ( "hex2mpi '%s' failed: %s\n" , gpg_strerror ( err ) ) ;
return val ;
} |
8,458,201,026,073,747,000 | debian | 42 | 0 | static int jbig2_decode_generic_template1 ( Jbig2Ctx * ctx , Jbig2Segment * segment , const Jbig2GenericRegionParams * params , Jbig2ArithState * as , Jbig2Image * image , Jbig2ArithCx * GB_stats ) {
const int GBW = image -> width ;
const int GBH = image -> height ;
const int rowstride = image -> stride ;
int x , y ;
byte * gbreg_line = ( byte * ) image -> data ;
# ifdef OUTPUT_PBM printf ( "P4\n%d %d\n" , GBW , GBH ) ;
# endif if ( GBW <= 0 ) return 0 ;
for ( y = 0 ;
y < GBH ;
y ++ ) {
uint32_t CONTEXT ;
uint32_t line_m1 ;
uint32_t line_m2 ;
int padded_width = ( GBW + 7 ) & - 8 ;
line_m1 = ( y >= 1 ) ? gbreg_line [ - rowstride ] : 0 ;
line_m2 = ( y >= 2 ) ? gbreg_line [ - ( rowstride << 1 ) ] << 5 : 0 ;
CONTEXT = ( ( line_m1 >> 1 ) & 0x1f8 ) | ( ( line_m2 >> 1 ) & 0x1e00 ) ;
for ( x = 0 ;
x < padded_width ;
x += 8 ) {
byte result = 0 ;
int x_minor ;
int minor_width = GBW - x > 8 ? 8 : GBW - x ;
if ( y >= 1 ) line_m1 = ( line_m1 << 8 ) | ( x + 8 < GBW ? gbreg_line [ - rowstride + ( x >> 3 ) + 1 ] : 0 ) ;
if ( y >= 2 ) line_m2 = ( line_m2 << 8 ) | ( x + 8 < GBW ? gbreg_line [ - ( rowstride << 1 ) + ( x >> 3 ) + 1 ] << 5 : 0 ) ;
for ( x_minor = 0 ;
x_minor < minor_width ;
x_minor ++ ) {
bool bit ;
bit = jbig2_arith_decode ( as , & GB_stats [ CONTEXT ] ) ;
if ( bit < 0 ) return - 1 ;
result |= bit << ( 7 - x_minor ) ;
CONTEXT = ( ( CONTEXT & 0xefb ) << 1 ) | bit | ( ( line_m1 >> ( 8 - x_minor ) ) & 0x8 ) | ( ( line_m2 >> ( 8 - x_minor ) ) & 0x200 ) ;
}
gbreg_line [ x >> 3 ] = result ;
}
# ifdef OUTPUT_PBM fwrite ( gbreg_line , 1 , rowstride , stdout ) ;
# endif gbreg_line += rowstride ;
}
return 0 ;
} |
1,896,723,564,367,514,400 | debian | 6 | 0 | static VALUE ossl_s_ciphers ( VALUE self ) {
VALUE ary ;
ary = rb_ary_new ( ) ;
OBJ_NAME_do_all_sorted ( OBJ_NAME_TYPE_CIPHER_METH , ( void ( * ) ( const OBJ_NAME * , void * ) ) add_cipher_name_to_ary , ( void * ) ary ) ;
return ary ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_T_object ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_object_identifier_str ( tvb , offset , actx , tree , hf_index , & nsiOID ) ;
return offset ;
} |
8,212,580,752,983,153,000 | debian | 236 | 0 | static Image * ReadHDRImage ( const ImageInfo * image_info , ExceptionInfo * exception ) {
char format [ MagickPathExtent ] , keyword [ MagickPathExtent ] , tag [ MagickPathExtent ] , value [ MagickPathExtent ] ;
double gamma ;
Image * image ;
int c ;
MagickBooleanType status , value_expected ;
register Quantum * q ;
register ssize_t i , x ;
register unsigned char * p ;
ssize_t count , y ;
unsigned char * end , pixel [ 4 ] , * pixels ;
assert ( image_info != ( const ImageInfo * ) NULL ) ;
assert ( image_info -> signature == MagickCoreSignature ) ;
if ( image_info -> debug != MagickFalse ) ( void ) LogMagickEvent ( TraceEvent , GetMagickModule ( ) , "%s" , image_info -> filename ) ;
assert ( exception != ( ExceptionInfo * ) NULL ) ;
assert ( exception -> signature == MagickCoreSignature ) ;
image = AcquireImage ( image_info , exception ) ;
status = OpenBlob ( image_info , image , ReadBinaryBlobMode , exception ) ;
if ( status == MagickFalse ) {
image = DestroyImageList ( image ) ;
return ( ( Image * ) NULL ) ;
}
image -> columns = 0 ;
image -> rows = 0 ;
* format = '\0' ;
c = ReadBlobByte ( image ) ;
if ( c == EOF ) {
image = DestroyImage ( image ) ;
return ( ( Image * ) NULL ) ;
}
while ( isgraph ( c ) && ( image -> columns == 0 ) && ( image -> rows == 0 ) ) {
if ( c == ( int ) '#' ) {
char * comment ;
register char * p ;
size_t length ;
length = MagickPathExtent ;
comment = AcquireString ( ( char * ) NULL ) ;
for ( p = comment ;
comment != ( char * ) NULL ;
p ++ ) {
c = ReadBlobByte ( image ) ;
if ( ( c == EOF ) || ( c == ( int ) '\n' ) ) break ;
if ( ( size_t ) ( p - comment + 1 ) >= length ) {
* p = '\0' ;
length <<= 1 ;
comment = ( char * ) ResizeQuantumMemory ( comment , length + MagickPathExtent , sizeof ( * comment ) ) ;
if ( comment == ( char * ) NULL ) break ;
p = comment + strlen ( comment ) ;
}
* p = ( char ) c ;
}
if ( comment == ( char * ) NULL ) ThrowReaderException ( ResourceLimitError , "MemoryAllocationFailed" ) ;
* p = '\0' ;
( void ) SetImageProperty ( image , "comment" , comment , exception ) ;
comment = DestroyString ( comment ) ;
c = ReadBlobByte ( image ) ;
}
else if ( isalnum ( c ) == MagickFalse ) c = ReadBlobByte ( image ) ;
else {
register char * p ;
p = keyword ;
do {
if ( ( size_t ) ( p - keyword ) < ( MagickPathExtent - 1 ) ) * p ++ = c ;
c = ReadBlobByte ( image ) ;
}
while ( isalnum ( c ) || ( c == '_' ) ) ;
* p = '\0' ;
value_expected = MagickFalse ;
while ( ( isspace ( ( int ) ( ( unsigned char ) c ) ) != 0 ) || ( c == '=' ) ) {
if ( c == '=' ) value_expected = MagickTrue ;
c = ReadBlobByte ( image ) ;
}
if ( LocaleCompare ( keyword , "Y" ) == 0 ) value_expected = MagickTrue ;
if ( value_expected == MagickFalse ) continue ;
p = value ;
while ( ( c != '\n' ) && ( c != '\0' ) && ( c != EOF ) ) {
if ( ( size_t ) ( p - value ) < ( MagickPathExtent - 1 ) ) * p ++ = c ;
c = ReadBlobByte ( image ) ;
}
* p = '\0' ;
switch ( * keyword ) {
case 'F' : case 'f' : {
if ( LocaleCompare ( keyword , "format" ) == 0 ) {
( void ) CopyMagickString ( format , value , MagickPathExtent ) ;
break ;
}
( void ) FormatLocaleString ( tag , MagickPathExtent , "hdr:%s" , keyword ) ;
( void ) SetImageProperty ( image , tag , value , exception ) ;
break ;
}
case 'G' : case 'g' : {
if ( LocaleCompare ( keyword , "gamma" ) == 0 ) {
image -> gamma = StringToDouble ( value , ( char * * ) NULL ) ;
break ;
}
( void ) FormatLocaleString ( tag , MagickPathExtent , "hdr:%s" , keyword ) ;
( void ) SetImageProperty ( image , tag , value , exception ) ;
break ;
}
case 'P' : case 'p' : {
if ( LocaleCompare ( keyword , "primaries" ) == 0 ) {
float chromaticity [ 6 ] , white_point [ 2 ] ;
int count ;
count = sscanf ( value , "%g %g %g %g %g %g %g %g" , & chromaticity [ 0 ] , & chromaticity [ 1 ] , & chromaticity [ 2 ] , & chromaticity [ 3 ] , & chromaticity [ 4 ] , & chromaticity [ 5 ] , & white_point [ 0 ] , & white_point [ 1 ] ) ;
if ( count == 8 ) {
image -> chromaticity . red_primary . x = chromaticity [ 0 ] ;
image -> chromaticity . red_primary . y = chromaticity [ 1 ] ;
image -> chromaticity . green_primary . x = chromaticity [ 2 ] ;
image -> chromaticity . green_primary . y = chromaticity [ 3 ] ;
image -> chromaticity . blue_primary . x = chromaticity [ 4 ] ;
image -> chromaticity . blue_primary . y = chromaticity [ 5 ] ;
image -> chromaticity . white_point . x = white_point [ 0 ] , image -> chromaticity . white_point . y = white_point [ 1 ] ;
}
break ;
}
( void ) FormatLocaleString ( tag , MagickPathExtent , "hdr:%s" , keyword ) ;
( void ) SetImageProperty ( image , tag , value , exception ) ;
break ;
}
case 'Y' : case 'y' : {
char target [ ] = "Y" ;
if ( strcmp ( keyword , target ) == 0 ) {
int height , width ;
if ( sscanf ( value , "%d +X %d" , & height , & width ) == 2 ) {
image -> columns = ( size_t ) width ;
image -> rows = ( size_t ) height ;
}
break ;
}
( void ) FormatLocaleString ( tag , MagickPathExtent , "hdr:%s" , keyword ) ;
( void ) SetImageProperty ( image , tag , value , exception ) ;
break ;
}
default : {
( void ) FormatLocaleString ( tag , MagickPathExtent , "hdr:%s" , keyword ) ;
( void ) SetImageProperty ( image , tag , value , exception ) ;
break ;
}
}
}
if ( ( image -> columns == 0 ) && ( image -> rows == 0 ) ) while ( isspace ( ( int ) ( ( unsigned char ) c ) ) != 0 ) c = ReadBlobByte ( image ) ;
}
if ( ( LocaleCompare ( format , "32-bit_rle_rgbe" ) != 0 ) && ( LocaleCompare ( format , "32-bit_rle_xyze" ) != 0 ) ) ThrowReaderException ( CorruptImageError , "ImproperImageHeader" ) ;
if ( ( image -> columns == 0 ) || ( image -> rows == 0 ) ) ThrowReaderException ( CorruptImageError , "NegativeOrZeroImageSize" ) ;
( void ) SetImageColorspace ( image , RGBColorspace , exception ) ;
if ( LocaleCompare ( format , "32-bit_rle_xyze" ) == 0 ) ( void ) SetImageColorspace ( image , XYZColorspace , exception ) ;
image -> compression = ( image -> columns < 8 ) || ( image -> columns > 0x7ffff ) ? NoCompression : RLECompression ;
if ( image_info -> ping != MagickFalse ) {
( void ) CloseBlob ( image ) ;
return ( GetFirstImageInList ( image ) ) ;
}
status = SetImageExtent ( image , image -> columns , image -> rows , exception ) ;
if ( status == MagickFalse ) return ( DestroyImageList ( image ) ) ;
pixels = ( unsigned char * ) AcquireQuantumMemory ( image -> columns , 4 * sizeof ( * pixels ) ) ;
if ( pixels == ( unsigned char * ) NULL ) ThrowReaderException ( ResourceLimitError , "MemoryAllocationFailed" ) ;
for ( y = 0 ;
y < ( ssize_t ) image -> rows ;
y ++ ) {
if ( image -> compression != RLECompression ) {
count = ReadBlob ( image , 4 * image -> columns * sizeof ( * pixels ) , pixels ) ;
if ( count != ( ssize_t ) ( 4 * image -> columns * sizeof ( * pixels ) ) ) break ;
}
else {
count = ReadBlob ( image , 4 * sizeof ( * pixel ) , pixel ) ;
if ( count != 4 ) break ;
if ( ( size_t ) ( ( ( ( size_t ) pixel [ 2 ] ) << 8 ) | pixel [ 3 ] ) != image -> columns ) {
( void ) memcpy ( pixels , pixel , 4 * sizeof ( * pixel ) ) ;
count = ReadBlob ( image , 4 * ( image -> columns - 1 ) * sizeof ( * pixels ) , pixels + 4 ) ;
image -> compression = NoCompression ;
}
else {
p = pixels ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
end = & pixels [ ( i + 1 ) * image -> columns ] ;
while ( p < end ) {
count = ReadBlob ( image , 2 * sizeof ( * pixel ) , pixel ) ;
if ( count < 1 ) break ;
if ( pixel [ 0 ] > 128 ) {
count = ( ssize_t ) pixel [ 0 ] - 128 ;
if ( ( count == 0 ) || ( count > ( ssize_t ) ( end - p ) ) ) break ;
while ( count -- > 0 ) * p ++ = pixel [ 1 ] ;
}
else {
count = ( ssize_t ) pixel [ 0 ] ;
if ( ( count == 0 ) || ( count > ( ssize_t ) ( end - p ) ) ) break ;
* p ++ = pixel [ 1 ] ;
if ( -- count > 0 ) {
count = ReadBlob ( image , ( size_t ) count * sizeof ( * p ) , p ) ;
if ( count < 1 ) break ;
p += count ;
}
}
}
}
}
}
q = QueueAuthenticPixels ( image , 0 , y , image -> columns , 1 , exception ) ;
if ( q == ( Quantum * ) NULL ) break ;
i = 0 ;
for ( x = 0 ;
x < ( ssize_t ) image -> columns ;
x ++ ) {
if ( image -> compression == RLECompression ) {
pixel [ 0 ] = pixels [ x ] ;
pixel [ 1 ] = pixels [ x + image -> columns ] ;
pixel [ 2 ] = pixels [ x + 2 * image -> columns ] ;
pixel [ 3 ] = pixels [ x + 3 * image -> columns ] ;
}
else {
pixel [ 0 ] = pixels [ i ++ ] ;
pixel [ 1 ] = pixels [ i ++ ] ;
pixel [ 2 ] = pixels [ i ++ ] ;
pixel [ 3 ] = pixels [ i ++ ] ;
}
SetPixelRed ( image , 0 , q ) ;
SetPixelGreen ( image , 0 , q ) ;
SetPixelBlue ( image , 0 , q ) ;
if ( pixel [ 3 ] != 0 ) {
gamma = pow ( 2.0 , pixel [ 3 ] - ( 128.0 + 8.0 ) ) ;
SetPixelRed ( image , ClampToQuantum ( QuantumRange * gamma * pixel [ 0 ] ) , q ) ;
SetPixelGreen ( image , ClampToQuantum ( QuantumRange * gamma * pixel [ 1 ] ) , q ) ;
SetPixelBlue ( image , ClampToQuantum ( QuantumRange * gamma * pixel [ 2 ] ) , q ) ;
}
q += GetPixelChannels ( image ) ;
}
if ( SyncAuthenticPixels ( image , exception ) == MagickFalse ) break ;
status = SetImageProgress ( image , LoadImageTag , ( MagickOffsetType ) y , image -> rows ) ;
if ( status == MagickFalse ) break ;
}
pixels = ( unsigned char * ) RelinquishMagickMemory ( pixels ) ;
if ( EOFBlob ( image ) != MagickFalse ) ThrowFileException ( exception , CorruptImageError , "UnexpectedEndOfFile" , image -> filename ) ;
( void ) CloseBlob ( image ) ;
return ( GetFirstImageInList ( image ) ) ;
} |
-8,054,970,867,770,516,000 | debian | 10 | 0 | static const u_char * print_sl_winchange ( netdissect_options * ndo , register const u_char * cp ) {
register short i ;
if ( ( i = * cp ++ ) == 0 ) {
i = EXTRACT_16BITS ( cp ) ;
cp += 2 ;
}
if ( i >= 0 ) ND_PRINT ( ( ndo , " W+%d" , i ) ) ;
else ND_PRINT ( ( ndo , " W%d" , i ) ) ;
return ( cp ) ;
} |
4,313,735,399,044,135,400 | debian | 12 | 0 | int psf_fclose ( SF_PRIVATE * psf ) {
int retval ;
if ( psf -> virtual_io ) return 0 ;
if ( psf -> file . do_not_close_descriptor ) {
psf -> file . filedes = - 1 ;
return 0 ;
}
;
if ( ( retval = psf_close_fd ( psf -> file . filedes ) ) == - 1 ) psf_log_syserr ( psf , errno ) ;
psf -> file . filedes = - 1 ;
return retval ;
} |
927,123,821,003,322,000 | chrome | 14 | 0 | IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , UseCounterFeaturesInMainFrame ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
auto waiter = CreatePageLoadMetricsWaiter ( ) ;
waiter -> AddPageExpectation ( TimingField : : LOAD_EVENT ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/page_load_metrics/use_counter_features.html" ) ) ;
waiter -> Wait ( ) ;
NavigateToUntrackedUrl ( ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kFeaturesHistogramName , static_cast < int32_t > ( WebFeature : : kTextWholeText ) , 1 ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kFeaturesHistogramName , static_cast < int32_t > ( WebFeature : : kV8Element_Animate_Method ) , 1 ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kFeaturesHistogramName , static_cast < int32_t > ( WebFeature : : kNavigatorVibrate ) , 1 ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kFeaturesHistogramName , static_cast < int32_t > ( WebFeature : : kDataUriHasOctothorpe ) , 1 ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kFeaturesHistogramName , static_cast < int32_t > ( WebFeature : : kApplicationCacheManifestSelectSecureOrigin ) , 1 ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kFeaturesHistogramName , static_cast < int32_t > ( WebFeature : : kPageVisits ) , 1 ) ;
} |
5,347,874,611,477,979,000 | chrome | 13 | 0 | static int cleanup_test ( void ) {
# ifndef WIN32 close ( pair [ 0 ] ) ;
close ( pair [ 1 ] ) ;
# else CloseHandle ( ( HANDLE ) pair [ 0 ] ) ;
CloseHandle ( ( HANDLE ) pair [ 1 ] ) ;
# endif if ( test_ok ) fprintf ( stdout , "OK\n" ) ;
else {
fprintf ( stdout , "FAILED\n" ) ;
exit ( 1 ) ;
}
test_ok = 0 ;
return ( 0 ) ;
} |
-7,455,544,248,455,991,000 | debian | 6 | 0 | static int kvm_deassign_irq_internal ( KVMState * s , uint32_t dev_id , uint32_t type ) {
struct kvm_assigned_irq assigned_irq = {
. assigned_dev_id = dev_id , . flags = type , }
;
return kvm_vm_ioctl ( s , KVM_DEASSIGN_DEV_IRQ , & assigned_irq ) ;
} |
-5,602,110,576,334,024,000 | debian | 35 | 0 | static void rice_decompress ( ALACContext * alac , int32_t * output_buffer , int nb_samples , int bps , int rice_history_mult ) {
int i ;
unsigned int history = alac -> rice_initial_history ;
int sign_modifier = 0 ;
for ( i = 0 ;
i < nb_samples ;
i ++ ) {
int k ;
unsigned int x ;
k = av_log2 ( ( history >> 9 ) + 3 ) ;
k = FFMIN ( k , alac -> rice_limit ) ;
x = decode_scalar ( & alac -> gb , k , bps ) ;
x += sign_modifier ;
sign_modifier = 0 ;
output_buffer [ i ] = ( x >> 1 ) ^ - ( x & 1 ) ;
if ( x > 0xffff ) history = 0xffff ;
else history += x * rice_history_mult - ( ( history * rice_history_mult ) >> 9 ) ;
if ( ( history < 128 ) && ( i + 1 < nb_samples ) ) {
int block_size ;
k = 7 - av_log2 ( history ) + ( ( history + 16 ) >> 6 ) ;
k = FFMIN ( k , alac -> rice_limit ) ;
block_size = decode_scalar ( & alac -> gb , k , 16 ) ;
if ( block_size > 0 ) {
if ( block_size >= nb_samples - i ) {
av_log ( alac -> avctx , AV_LOG_ERROR , "invalid zero block size of %d %d %d\n" , block_size , nb_samples , i ) ;
block_size = nb_samples - i - 1 ;
}
memset ( & output_buffer [ i + 1 ] , 0 , block_size * sizeof ( * output_buffer ) ) ;
i += block_size ;
}
if ( block_size <= 0xffff ) sign_modifier = 1 ;
history = 0 ;
}
}
} |
-2,423,144,171,479,607,000 | debian | 12 | 0 | static void pdf_run_d ( fz_context * ctx , pdf_processor * proc , pdf_obj * array , float phase ) {
pdf_run_processor * pr = ( pdf_run_processor * ) proc ;
pdf_gstate * gstate = pdf_flush_text ( ctx , pr ) ;
int len , i ;
len = pdf_array_len ( ctx , array ) ;
gstate -> stroke_state = fz_unshare_stroke_state_with_dash_len ( ctx , gstate -> stroke_state , len ) ;
gstate -> stroke_state -> dash_len = len ;
for ( i = 0 ;
i < len ;
i ++ ) gstate -> stroke_state -> dash_list [ i ] = pdf_to_real ( ctx , pdf_array_get ( ctx , array , i ) ) ;
gstate -> stroke_state -> dash_phase = phase ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_INTEGER_1_128 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 1U , 128U , NULL , FALSE ) ;
return offset ;
} |
1,245,821,301,839,614,700 | debian | 40 | 0 | static char * custom_basename_to_string ( char * format , va_list va ) {
GFile * file ;
GFileInfo * info ;
char * name , * basename , * tmp ;
GMount * mount ;
file = va_arg ( va , GFile * ) ;
if ( ( mount = nautilus_get_mounted_mount_for_root ( file ) ) != NULL ) {
name = g_mount_get_name ( mount ) ;
g_object_unref ( mount ) ;
}
else {
info = g_file_query_info ( file , G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME , 0 , g_cancellable_get_current ( ) , NULL ) ;
name = NULL ;
if ( info ) {
name = g_strdup ( g_file_info_get_display_name ( info ) ) ;
g_object_unref ( info ) ;
}
}
if ( name == NULL ) {
basename = g_file_get_basename ( file ) ;
if ( g_utf8_validate ( basename , - 1 , NULL ) ) {
name = basename ;
}
else {
name = g_uri_escape_string ( basename , G_URI_RESERVED_CHARS_ALLOWED_IN_PATH , TRUE ) ;
g_free ( basename ) ;
}
}
if ( has_invalid_xml_char ( name ) ) {
tmp = name ;
name = g_uri_escape_string ( name , G_URI_RESERVED_CHARS_ALLOWED_IN_PATH , TRUE ) ;
g_free ( tmp ) ;
}
if ( name != NULL ) {
tmp = name ;
name = eel_str_middle_truncate ( tmp , MAXIMUM_DISPLAYED_FILE_NAME_LENGTH ) ;
g_free ( tmp ) ;
}
return name ;
} |
3,804,373,597,256,531,000 | debian | 53 | 0 | bool acl_getroot_no_password ( Security_context * sctx , char * user , char * host , char * ip , char * db ) {
int res = 1 ;
uint i ;
ACL_USER * acl_user = 0 ;
DBUG_ENTER ( "acl_getroot_no_password" ) ;
DBUG_PRINT ( "enter" , ( "Host: '%s', Ip: '%s', User: '%s', db: '%s'" , ( host ? host : "(NULL)" ) , ( ip ? ip : "(NULL)" ) , user , ( db ? db : "(NULL)" ) ) ) ;
sctx -> user = user ;
sctx -> host = host ;
sctx -> ip = ip ;
sctx -> host_or_ip = host ? host : ( ip ? ip : "" ) ;
if ( ! initialized ) {
sctx -> skip_grants ( ) ;
DBUG_RETURN ( FALSE ) ;
}
VOID ( pthread_mutex_lock ( & acl_cache -> lock ) ) ;
sctx -> master_access = 0 ;
sctx -> db_access = 0 ;
sctx -> priv_user = ( char * ) "" ;
* sctx -> priv_host = 0 ;
for ( i = 0 ;
i < acl_users . elements ;
i ++ ) {
ACL_USER * acl_user_tmp = dynamic_element ( & acl_users , i , ACL_USER * ) ;
if ( ( ! acl_user_tmp -> user && ! user [ 0 ] ) || ( acl_user_tmp -> user && strcmp ( user , acl_user_tmp -> user ) == 0 ) ) {
if ( compare_hostname ( & acl_user_tmp -> host , host , ip ) ) {
acl_user = acl_user_tmp ;
res = 0 ;
break ;
}
}
}
if ( acl_user ) {
for ( i = 0 ;
i < acl_dbs . elements ;
i ++ ) {
ACL_DB * acl_db = dynamic_element ( & acl_dbs , i , ACL_DB * ) ;
if ( ! acl_db -> user || ( user && user [ 0 ] && ! strcmp ( user , acl_db -> user ) ) ) {
if ( compare_hostname ( & acl_db -> host , host , ip ) ) {
if ( ! acl_db -> db || ( db && ! wild_compare ( db , acl_db -> db , 0 ) ) ) {
sctx -> db_access = acl_db -> access ;
break ;
}
}
}
}
sctx -> master_access = acl_user -> access ;
sctx -> priv_user = acl_user -> user ? user : ( char * ) "" ;
if ( acl_user -> host . hostname ) strmake ( sctx -> priv_host , acl_user -> host . hostname , MAX_HOSTNAME - 1 ) ;
else * sctx -> priv_host = 0 ;
}
VOID ( pthread_mutex_unlock ( & acl_cache -> lock ) ) ;
DBUG_RETURN ( res ) ;
} |
-1,658,505,547,857,059,300 | debian | 11 | 0 | static void pic_as_field ( Picture * pic , const int parity ) {
int i ;
for ( i = 0 ;
i < 4 ;
++ i ) {
if ( parity == PICT_BOTTOM_FIELD ) pic -> f . data [ i ] += pic -> f . linesize [ i ] ;
pic -> reference = parity ;
pic -> f . linesize [ i ] *= 2 ;
}
pic -> poc = pic -> field_poc [ parity == PICT_BOTTOM_FIELD ] ;
} |
-1,315,695,702,746,584,300 | debian | 17 | 0 | static gboolean check_for_undecoded ( proto_node * node , gpointer data ) {
field_info * fi = PNODE_FINFO ( node ) ;
gchar * decoded = ( gchar * ) data ;
gint i ;
guint byte ;
guint bit ;
if ( fi && fi -> hfinfo -> type != FT_PROTOCOL ) {
for ( i = fi -> start ;
i < fi -> start + fi -> length ;
i ++ ) {
byte = i / 8 ;
bit = i % 8 ;
decoded [ byte ] |= ( 1 << bit ) ;
}
}
return FALSE ;
} |
-7,441,512,654,057,958,000 | chrome | 7 | 1 | TEST ( BuildTime , TimeLooksValid ) {
# if defined ( DONT_EMBED_BUILD_METADATA ) char build_time [ ] = "08:00:00" ;
# else char build_time [ ] = __TIME__ ;
# endif EXPECT_EQ ( 8u , strlen ( build_time ) ) ;
EXPECT_EQ ( ':' , build_time [ 2 ] ) ;
EXPECT_EQ ( ':' , build_time [ 5 ] ) ;
} |
-1,145,838,621,747,570,400 | debian | 12 | 0 | void key_set_timeout ( struct key * key , unsigned timeout ) {
struct timespec now ;
time_t expiry = 0 ;
down_write ( & key -> sem ) ;
if ( timeout > 0 ) {
now = current_kernel_time ( ) ;
expiry = now . tv_sec + timeout ;
}
key -> expiry = expiry ;
key_schedule_gc ( key -> expiry + key_gc_delay ) ;
up_write ( & key -> sem ) ;
} |
7,607,805,321,589,710,000 | debian | 5 | 0 | static int zcvn ( i_ctx_t * i_ctx_p ) {
os_ptr op = osp ;
check_read_type ( * op , t_string ) ;
return name_from_string ( imemory , op , op ) ;
} |