Deep Learning based Vulnerability Detection: Are We There Yet?
Paper
•
2009.07235
•
Published
idx
int64 | target
int64 | func
string |
|---|---|---|
0
| 0
|
static int get_zbin_mode_boost ( const MB_MODE_INFO * mbmi , int enabled ) {
if ( enabled ) {
if ( is_inter_block ( mbmi ) ) {
if ( mbmi -> mode == ZEROMV ) {
return mbmi -> ref_frame [ 0 ] != LAST_FRAME ? GF_ZEROMV_ZBIN_BOOST : LF_ZEROMV_ZBIN_BOOST ;
}
else {
return mbmi -> sb_type < BLOCK_8X8 ? SPLIT_MV_ZBIN_BOOST : MV_ZBIN_BOOST ;
}
}
else {
return INTRA_ZBIN_BOOST ;
}
}
else {
return 0 ;
}
}
|
1
| 0
|
static int SpoolssGetPrinter_r ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep _U_ ) {
dcerpc_call_value * dcv = ( dcerpc_call_value * ) di -> call_data ;
BUFFER buffer ;
gint16 level = GPOINTER_TO_INT ( dcv -> se_data ) ;
proto_item * item = NULL ;
proto_tree * subtree = NULL ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , ", level %d" , level ) ;
offset = dissect_spoolss_buffer ( tvb , offset , pinfo , tree , di , drep , & buffer ) ;
if ( buffer . tvb ) {
subtree = proto_tree_add_subtree_format ( buffer . tree , buffer . tvb , 0 , - 1 , ett_PRINTER_INFO , & item , "Print info level %d" , level ) ;
switch ( level ) {
case 0 : dissect_PRINTER_INFO_0 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 1 : dissect_PRINTER_INFO_1 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 2 : dissect_PRINTER_INFO_2 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 3 : dissect_PRINTER_INFO_3 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 7 : dissect_PRINTER_INFO_7 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
default : expert_add_info ( pinfo , item , & ei_printer_info_level ) ;
break ;
}
}
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , tree , di , drep , hf_needed , NULL ) ;
offset = dissect_doserror ( tvb , offset , pinfo , tree , di , drep , hf_rc , NULL ) ;
return offset ;
}
|
2
| 0
|
PKCS8_PRIV_KEY_INFO * d2i_PKCS8_PRIV_KEY_INFO_fp ( FILE * fp , PKCS8_PRIV_KEY_INFO * * p8inf ) {
return ASN1_d2i_fp_of ( PKCS8_PRIV_KEY_INFO , PKCS8_PRIV_KEY_INFO_new , d2i_PKCS8_PRIV_KEY_INFO , fp , p8inf ) ;
}
|
3
| 0
|
int i2d_PKCS7_bio ( BIO * bp , PKCS7 * p7 ) {
return ASN1_item_i2d_bio ( ASN1_ITEM_rptr ( PKCS7 ) , bp , p7 ) ;
}
|
4
| 0
|
static PyObject * string_mod ( PyObject * v , PyObject * w ) {
if ( ! PyString_Check ( v ) ) {
Py_INCREF ( Py_NotImplemented ) ;
return Py_NotImplemented ;
}
return PyString_Format ( v , w ) ;
}
|
5
| 0
|
int64_t cpu_get_icount ( void ) {
int64_t icount ;
CPUState * cpu = current_cpu ;
icount = qemu_icount ;
if ( cpu ) {
CPUArchState * env = cpu -> env_ptr ;
if ( ! can_do_io ( env ) ) {
fprintf ( stderr , "Bad clock read\n" ) ;
}
icount -= ( env -> icount_decr . u16 . low + env -> icount_extra ) ;
}
return qemu_icount_bias + ( icount << icount_time_shift ) ;
}
|
6
| 0
|
static void dtap_mm_imsi_det_ind ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) {
guint32 curr_offset ;
guint32 consumed ;
guint curr_len ;
curr_offset = offset ;
curr_len = len ;
is_uplink = IS_UPLINK_TRUE ;
ELEM_MAND_V ( GSM_A_PDU_TYPE_COMMON , DE_MS_CM_1 , NULL ) ;
ELEM_MAND_LV ( GSM_A_PDU_TYPE_COMMON , DE_MID , NULL ) ;
EXTRANEOUS_DATA_CHECK ( curr_len , 0 , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
}
|
7
| 0
|
static int dissect_h245_EscrowData ( 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_EscrowData , EscrowData_sequence ) ;
return offset ;
}
|
8
| 0
|
void var_set_int ( const char * name , int value ) {
char buf [ 21 ] ;
my_snprintf ( buf , sizeof ( buf ) , "%d" , value ) ;
var_set_string ( name , buf ) ;
}
|
9
| 0
|
int16_t vp9_dc_quant ( int qindex , int delta , vpx_bit_depth_t bit_depth ) {
# if CONFIG_VP9_HIGHBITDEPTH switch ( bit_depth ) {
case VPX_BITS_8 : return dc_qlookup [ clamp ( qindex + delta , 0 , MAXQ ) ] ;
case VPX_BITS_10 : return dc_qlookup_10 [ clamp ( qindex + delta , 0 , MAXQ ) ] ;
case VPX_BITS_12 : return dc_qlookup_12 [ clamp ( qindex + delta , 0 , MAXQ ) ] ;
default : assert ( 0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12" ) ;
return - 1 ;
}
# else ( void ) bit_depth ;
return dc_qlookup [ clamp ( qindex + delta , 0 , MAXQ ) ] ;
# endif }
|
10
| 0
|
GType hb_gobject_ ## name ## _get_type ( void ) \ {
static gsize type_id = 0 ;
if ( g_once_init_enter ( & type_id ) ) {
GType id = g_boxed_type_register_static ( g_intern_static_string ( "hb_" # name "_t" ) , ( GBoxedCopyFunc ) copy_func , ( GBoxedFreeFunc ) free_func ) ;
g_once_init_leave ( & type_id , id ) ;
}
return type_id ;
\ }
# define HB_DEFINE_OBJECT_TYPE ( name ) HB_DEFINE_BOXED_TYPE ( name , hb_ ## name ## _reference , hb_ ## name ## _destroy ) ;
# define HB_DEFINE_VALUE_TYPE ( name ) static hb_ ## name ## _t * _hb_ ## name ## _reference ( const hb_ ## name ## _t * l ) {
hb_ ## name ## _t * c = ( hb_ ## name ## _t * ) calloc ( 1 , sizeof ( hb_ ## name ## _t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * l ;
return c ;
}
static void _hb_ ## name ## _destroy ( hb_ ## name ## _t * l ) {
free ( l ) ;
}
HB_DEFINE_BOXED_TYPE ( name , _hb_ ## name ## _reference , _hb_ ## name ## _destroy ) ;
HB_DEFINE_OBJECT_TYPE ( buffer ) HB_DEFINE_OBJECT_TYPE ( blob ) HB_DEFINE_OBJECT_TYPE ( face ) HB_DEFINE_OBJECT_TYPE ( font ) HB_DEFINE_OBJECT_TYPE ( font_funcs ) HB_DEFINE_OBJECT_TYPE ( set )
|
11
| 0
|
static int dissect_h245_T_rfc2733Mode ( 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_rfc2733Mode , T_rfc2733Mode_sequence ) ;
return offset ;
}
|
12
| 0
|
unsigned int vp9_sub_pixel_avg_variance ## W ## x ## H ## _c ( const uint8_t * src , int src_stride , int xoffset , int yoffset , const uint8_t * dst , int dst_stride , unsigned int * sse , const uint8_t * second_pred ) {
uint16_t fdata3 [ ( H + 1 ) * W ] ;
uint8_t temp2 [ H * W ] ;
DECLARE_ALIGNED_ARRAY ( 16 , uint8_t , temp3 , H * W ) ;
var_filter_block2d_bil_first_pass ( src , fdata3 , src_stride , 1 , H + 1 , W , BILINEAR_FILTERS_2TAP ( xoffset ) ) ;
var_filter_block2d_bil_second_pass ( fdata3 , temp2 , W , W , H , W , BILINEAR_FILTERS_2TAP ( yoffset ) ) ;
vp9_comp_avg_pred ( temp3 , second_pred , W , H , temp2 , W ) ;
return vp9_variance ## W ## x ## H ## _c ( temp3 , W , dst , dst_stride , sse ) ;
\ }
void vp9_get16x16var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 16 , 16 , sse , sum ) ;
}
void vp9_get8x8var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 8 , 8 , sse , sum ) ;
}
unsigned int vp9_mse16x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse16x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 8 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 8 , sse , & sum ) ;
return * sse ;
}
VAR ( 4 , 4 ) SUBPIX_VAR ( 4 , 4 ) SUBPIX_AVG_VAR ( 4 , 4 ) VAR ( 4 , 8 ) SUBPIX_VAR ( 4 , 8 ) SUBPIX_AVG_VAR ( 4 , 8 ) VAR ( 8 , 4 ) SUBPIX_VAR ( 8 , 4 ) SUBPIX_AVG_VAR ( 8 , 4 ) VAR ( 8 , 8 ) SUBPIX_VAR ( 8 , 8 ) SUBPIX_AVG_VAR ( 8 , 8 ) VAR ( 8 , 16 ) SUBPIX_VAR ( 8 , 16 ) SUBPIX_AVG_VAR ( 8 , 16 ) VAR ( 16 , 8 ) SUBPIX_VAR ( 16 , 8 ) SUBPIX_AVG_VAR ( 16 , 8 ) VAR ( 16 , 16 ) SUBPIX_VAR ( 16 , 16 ) SUBPIX_AVG_VAR ( 16 , 16 ) VAR ( 16 , 32 ) SUBPIX_VAR ( 16 , 32 ) SUBPIX_AVG_VAR ( 16 , 32 ) VAR ( 32 , 16 ) SUBPIX_VAR ( 32 , 16 ) SUBPIX_AVG_VAR ( 32 , 16 ) VAR ( 32 , 32 ) SUBPIX_VAR ( 32 , 32 ) SUBPIX_AVG_VAR ( 32 , 32 )
|
13
| 0
|
static int com_prompt ( String * buffer __attribute__ ( ( unused ) ) , char * line ) {
char * ptr = strchr ( line , ' ' ) ;
prompt_counter = 0 ;
my_free ( current_prompt ) ;
current_prompt = my_strdup ( ptr ? ptr + 1 : default_prompt , MYF ( MY_WME ) ) ;
if ( ! ptr ) tee_fprintf ( stdout , "Returning to default PROMPT of %s\n" , default_prompt ) ;
else tee_fprintf ( stdout , "PROMPT set to '%s'\n" , current_prompt ) ;
return 0 ;
}
|
14
| 0
|
void vp9_encode_sby_pass1 ( MACROBLOCK * x , BLOCK_SIZE bsize ) {
vp9_subtract_plane ( x , bsize , 0 ) ;
vp9_foreach_transformed_block_in_plane ( & x -> e_mbd , bsize , 0 , encode_block_pass1 , x ) ;
}
|
15
| 0
|
static int dissect_h245_H263Resolution ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_H263Resolution , H263Resolution_choice , NULL ) ;
return offset ;
}
|
16
| 0
|
TEST_F ( NativeBackendLibsecretTest , PSLMatchingPositive ) {
PasswordForm result ;
const GURL kMobileURL ( "http://m.facebook.com/" ) ;
EXPECT_TRUE ( CheckCredentialAvailability ( form_facebook_ , kMobileURL , PasswordForm : : SCHEME_HTML , & result ) ) ;
EXPECT_EQ ( form_facebook_ . origin , result . origin ) ;
EXPECT_EQ ( form_facebook_ . signon_realm , result . signon_realm ) ;
}
|
17
| 0
|
static int dumpglyphs ( SplineFont * sf , struct glyphinfo * gi ) {
int i ;
int fixed = gi -> fixed_width ;
int answer , answered = - 1 ;
ff_progress_change_stages ( 2 + gi -> strikecnt ) ;
QuickBlues ( sf , gi -> layer , & gi -> bd ) ;
ff_progress_next_stage ( ) ;
if ( ! gi -> onlybitmaps ) {
if ( sf -> layers [ gi -> layer ] . order2 ) for ( i = 0 ;
i < sf -> glyphcnt ;
++ i ) {
SplineChar * sc = sf -> glyphs [ i ] ;
if ( SCWorthOutputting ( sc ) ) if ( ! SCPointsNumberedProperly ( sc , gi -> layer ) ) {
if ( answered == - 1 && sc -> ttf_instrs_len != 0 ) {
char * buts [ 5 ] ;
buts [ 0 ] = _ ( "_Yes" ) ;
buts [ 1 ] = _ ( "Yes to _All" ) ;
buts [ 2 ] = _ ( "No _to All" ) ;
buts [ 3 ] = _ ( "_No" ) ;
buts [ 4 ] = NULL ;
ff_progress_pause_timer ( ) ;
answer = ff_ask ( _ ( "Bad Point Numbering" ) , ( const char * * ) buts , 0 , 3 , _ ( "The points in %s are not numbered properly. This means that any instructions will probably move the wrong points and do the wrong thing.\nWould you like me to remove the instructions?" ) , sc -> name ) ;
if ( answer == 1 || answer == 2 ) answered = answer ;
}
else answer = answered ;
if ( answer == 0 ) {
free ( sc -> ttf_instrs ) ;
sc -> ttf_instrs = NULL ;
sc -> ttf_instrs_len = 0 ;
SCMarkInstrDlgAsChanged ( sc ) ;
}
SCNumberPoints ( sc , gi -> layer ) ;
}
}
}
gi -> maxp -> numGlyphs = gi -> gcnt ;
gi -> loca = malloc ( ( gi -> maxp -> numGlyphs + 1 ) * sizeof ( uint32 ) ) ;
gi -> pointcounts = malloc ( ( gi -> maxp -> numGlyphs + 1 ) * sizeof ( int32 ) ) ;
memset ( gi -> pointcounts , - 1 , ( gi -> maxp -> numGlyphs + 1 ) * sizeof ( int32 ) ) ;
gi -> next_glyph = 0 ;
gi -> glyphs = tmpfile ( ) ;
gi -> hmtx = tmpfile ( ) ;
if ( sf -> hasvmetrics ) gi -> vmtx = tmpfile ( ) ;
FigureFullMetricsEnd ( sf , gi , true ) ;
if ( fixed > 0 ) {
gi -> lasthwidth = 3 ;
gi -> hfullcnt = 3 ;
}
for ( i = 0 ;
i < gi -> gcnt ;
++ i ) {
if ( i == 0 ) {
if ( gi -> bygid [ 0 ] != - 1 && ( fixed <= 0 || sf -> glyphs [ gi -> bygid [ 0 ] ] -> width == fixed ) ) dumpglyph ( sf -> glyphs [ gi -> bygid [ 0 ] ] , gi ) ;
else dumpmissingglyph ( sf , gi , fixed ) ;
}
else if ( i <= 2 && gi -> bygid [ i ] == - 1 ) dumpblankglyph ( gi , sf , fixed ) ;
else if ( gi -> onlybitmaps ) {
if ( gi -> bygid [ i ] != - 1 && sf -> glyphs [ gi -> bygid [ i ] ] -> ttf_glyph > 0 ) dumpspace ( sf -> glyphs [ gi -> bygid [ i ] ] , gi ) ;
}
else {
if ( gi -> bygid [ i ] != - 1 && sf -> glyphs [ gi -> bygid [ i ] ] -> ttf_glyph > 0 ) {
if ( IsTTFRefable ( sf -> glyphs [ gi -> bygid [ i ] ] , gi -> layer ) ) dumpcomposite ( sf -> glyphs [ gi -> bygid [ i ] ] , gi ) ;
else dumpglyph ( sf -> glyphs [ gi -> bygid [ i ] ] , gi ) ;
}
}
if ( ( ftell ( gi -> glyphs ) & 3 ) != 0 ) {
if ( ftell ( gi -> glyphs ) & 1 ) putc ( '\0' , gi -> glyphs ) ;
if ( ftell ( gi -> glyphs ) & 2 ) putshort ( gi -> glyphs , 0 ) ;
}
if ( ! ff_progress_next ( ) ) return ( false ) ;
}
gi -> loca [ gi -> next_glyph ] = ftell ( gi -> glyphs ) ;
gi -> glyph_len = ftell ( gi -> glyphs ) ;
gi -> hmtxlen = ftell ( gi -> hmtx ) ;
if ( gi -> hmtxlen & 2 ) putshort ( gi -> hmtx , 0 ) ;
if ( gi -> loca [ gi -> next_glyph ] & 3 ) {
for ( i = 4 - ( gi -> loca [ gi -> next_glyph ] & 3 ) ;
i > 0 ;
-- i ) putc ( '\0' , gi -> glyphs ) ;
}
if ( sf -> hasvmetrics ) {
gi -> vmtxlen = ftell ( gi -> vmtx ) ;
if ( gi -> vmtxlen & 2 ) putshort ( gi -> vmtx , 0 ) ;
}
if ( ! sf -> layers [ gi -> layer ] . order2 ) RefigureCompositeMaxPts ( sf , gi ) ;
free ( gi -> pointcounts ) ;
return ( true ) ;
}
|
18
| 1
|
static int set_and_cost_bmi_mvs ( VP9_COMP * cpi , MACROBLOCKD * xd , int i , PREDICTION_MODE mode , int_mv this_mv [ 2 ] , int_mv frame_mv [ MB_MODE_COUNT ] [ MAX_REF_FRAMES ] , int_mv seg_mvs [ MAX_REF_FRAMES ] , int_mv * best_ref_mv [ 2 ] , const int * mvjcost , int * mvcost [ 2 ] ) {
MODE_INFO * const mic = xd -> mi [ 0 ] ;
const MB_MODE_INFO * const mbmi = & mic -> mbmi ;
int thismvcost = 0 ;
int idx , idy ;
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup [ mbmi -> sb_type ] ;
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup [ mbmi -> sb_type ] ;
const int is_compound = has_second_ref ( mbmi ) ;
switch ( mode ) {
case NEWMV : this_mv [ 0 ] . as_int = seg_mvs [ mbmi -> ref_frame [ 0 ] ] . as_int ;
thismvcost += vp9_mv_bit_cost ( & this_mv [ 0 ] . as_mv , & best_ref_mv [ 0 ] -> as_mv , mvjcost , mvcost , MV_COST_WEIGHT_SUB ) ;
if ( is_compound ) {
this_mv [ 1 ] . as_int = seg_mvs [ mbmi -> ref_frame [ 1 ] ] . as_int ;
thismvcost += vp9_mv_bit_cost ( & this_mv [ 1 ] . as_mv , & best_ref_mv [ 1 ] -> as_mv , mvjcost , mvcost , MV_COST_WEIGHT_SUB ) ;
}
break ;
case NEARMV : case NEARESTMV : this_mv [ 0 ] . as_int = frame_mv [ mode ] [ mbmi -> ref_frame [ 0 ] ] . as_int ;
if ( is_compound ) this_mv [ 1 ] . as_int = frame_mv [ mode ] [ mbmi -> ref_frame [ 1 ] ] . as_int ;
break ;
case ZEROMV : this_mv [ 0 ] . as_int = 0 ;
if ( is_compound ) this_mv [ 1 ] . as_int = 0 ;
break ;
default : break ;
}
mic -> bmi [ i ] . as_mv [ 0 ] . as_int = this_mv [ 0 ] . as_int ;
if ( is_compound ) mic -> bmi [ i ] . as_mv [ 1 ] . as_int = this_mv [ 1 ] . as_int ;
mic -> bmi [ i ] . as_mode = mode ;
for ( idy = 0 ;
idy < num_4x4_blocks_high ;
++ idy ) for ( idx = 0 ;
idx < num_4x4_blocks_wide ;
++ idx ) vpx_memcpy ( & mic -> bmi [ i + idy * 2 + idx ] , & mic -> bmi [ i ] , sizeof ( mic -> bmi [ i ] ) ) ;
return cost_mv_ref ( cpi , mode , mbmi -> mode_context [ mbmi -> ref_frame [ 0 ] ] ) + thismvcost ;
}
|
19
| 0
|
static php_uint32 phar_tar_checksum ( char * buf , int len ) {
php_uint32 sum = 0 ;
char * end = buf + len ;
while ( buf != end ) {
sum += ( unsigned char ) * buf ;
++ buf ;
}
return sum ;
}
|
20
| 0
|
static void imdct_output ( TwinContext * tctx , enum FrameType ftype , int wtype , float * * out ) {
const ModeTab * mtab = tctx -> mtab ;
int size1 , size2 ;
float * prev_buf = tctx -> prev_frame + tctx -> last_block_pos [ 0 ] ;
int i ;
for ( i = 0 ;
i < tctx -> avctx -> channels ;
i ++ ) {
imdct_and_window ( tctx , ftype , wtype , tctx -> spectrum + i * mtab -> size , prev_buf + 2 * i * mtab -> size , i ) ;
}
if ( ! out ) return ;
size2 = tctx -> last_block_pos [ 0 ] ;
size1 = mtab -> size - size2 ;
memcpy ( & out [ 0 ] [ 0 ] , prev_buf , size1 * sizeof ( out [ 0 ] [ 0 ] ) ) ;
memcpy ( & out [ 0 ] [ size1 ] , tctx -> curr_frame , size2 * sizeof ( out [ 0 ] [ 0 ] ) ) ;
if ( tctx -> avctx -> channels == 2 ) {
memcpy ( & out [ 1 ] [ 0 ] , & prev_buf [ 2 * mtab -> size ] , size1 * sizeof ( out [ 1 ] [ 0 ] ) ) ;
memcpy ( & out [ 1 ] [ size1 ] , & tctx -> curr_frame [ 2 * mtab -> size ] , size2 * sizeof ( out [ 1 ] [ 0 ] ) ) ;
tctx -> fdsp . butterflies_float ( out [ 0 ] , out [ 1 ] , mtab -> size ) ;
}
}
|
21
| 0
|
static int dissect_h245_KeyProtectionMethod ( 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_KeyProtectionMethod , KeyProtectionMethod_sequence ) ;
return offset ;
}
|
22
| 0
|
static int dissect_h245_SEQUENCE_OF_MultiplePayloadStreamElementMode ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index , ett_h245_SEQUENCE_OF_MultiplePayloadStreamElementMode , SEQUENCE_OF_MultiplePayloadStreamElementMode_sequence_of ) ;
return offset ;
}
|
23
| 0
|
static int dissect_h225_ConferenceList ( 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_h225_ConferenceList , ConferenceList_sequence ) ;
return offset ;
}
|
24
| 0
|
static void yy_symbol_value_print ( FILE * yyoutput , int yytype , YYSTYPE const * const yyvaluep ) # else static void yy_symbol_value_print ( yyoutput , yytype , yyvaluep ) FILE * yyoutput ;
int yytype ;
YYSTYPE const * const yyvaluep ;
# endif {
if ( ! yyvaluep ) return ;
# ifdef YYPRINT if ( yytype < YYNTOKENS ) YYPRINT ( yyoutput , yytoknum [ yytype ] , * yyvaluep ) ;
# else YYUSE ( yyoutput ) ;
# endif switch ( yytype ) {
default : break ;
}
}
|
25
| 0
|
void var_query_set ( VAR * var , const char * query , const char * * query_end ) {
char * end = ( char * ) ( ( query_end && * query_end ) ? * query_end : query + strlen ( query ) ) ;
MYSQL_RES * res ;
MYSQL_ROW row ;
MYSQL * mysql = cur_con -> mysql ;
DYNAMIC_STRING ds_query ;
DBUG_ENTER ( "var_query_set" ) ;
LINT_INIT ( res ) ;
if ( ! mysql ) {
struct st_command command ;
memset ( & command , 0 , sizeof ( command ) ) ;
command . query = ( char * ) query ;
command . first_word_len = ( * query_end - query ) ;
command . first_argument = command . query + command . first_word_len ;
command . end = ( char * ) * query_end ;
command . abort_on_error = 1 ;
handle_no_active_connection ( & command , cur_con , & ds_res ) ;
DBUG_VOID_RETURN ;
}
while ( end > query && * end != '`' ) {
if ( * end && ( * end != ' ' && * end != '\t' && * end != '\n' && * end != ')' ) ) die ( "Spurious text after `query` expression" ) ;
-- end ;
}
if ( query == end ) die ( "Syntax error in query, missing '`'" ) ;
++ query ;
init_dynamic_string ( & ds_query , 0 , ( end - query ) + 32 , 256 ) ;
do_eval ( & ds_query , query , end , FALSE ) ;
if ( mysql_real_query ( mysql , ds_query . str , ds_query . length ) ) {
handle_error ( curr_command , mysql_errno ( mysql ) , mysql_error ( mysql ) , mysql_sqlstate ( mysql ) , & ds_res ) ;
dynstr_free ( & ds_query ) ;
eval_expr ( var , "" , 0 ) ;
DBUG_VOID_RETURN ;
}
if ( ! ( res = mysql_store_result ( mysql ) ) ) {
report_or_die ( "Query '%s' didn't return a result set" , ds_query . str ) ;
dynstr_free ( & ds_query ) ;
eval_expr ( var , "" , 0 ) ;
return ;
}
dynstr_free ( & ds_query ) ;
if ( ( row = mysql_fetch_row ( res ) ) && row [ 0 ] ) {
DYNAMIC_STRING result ;
uint i ;
ulong * lengths ;
init_dynamic_string ( & result , "" , 512 , 512 ) ;
lengths = mysql_fetch_lengths ( res ) ;
for ( i = 0 ;
i < mysql_num_fields ( res ) ;
i ++ ) {
if ( row [ i ] ) {
char * val = row [ i ] ;
int len = lengths [ i ] ;
if ( glob_replace_regex ) {
if ( ! multi_reg_replace ( glob_replace_regex , ( char * ) val ) ) {
val = glob_replace_regex -> buf ;
len = strlen ( val ) ;
}
}
if ( glob_replace ) replace_strings_append ( glob_replace , & result , val , len ) ;
else dynstr_append_mem ( & result , val , len ) ;
}
dynstr_append_mem ( & result , "\t" , 1 ) ;
}
end = result . str + result . length - 1 ;
eval_expr ( var , result . str , ( const char * * ) & end , false , false ) ;
dynstr_free ( & result ) ;
}
else eval_expr ( var , "" , 0 ) ;
mysql_free_result ( res ) ;
DBUG_VOID_RETURN ;
}
|
26
| 0
|
static void * spl_ptr_llist_shift ( spl_ptr_llist * llist TSRMLS_DC ) {
void * data ;
spl_ptr_llist_element * head = llist -> head ;
if ( head == NULL ) {
return NULL ;
}
if ( head -> next ) {
head -> next -> prev = NULL ;
}
else {
llist -> tail = NULL ;
}
llist -> head = head -> next ;
llist -> count -- ;
data = head -> data ;
if ( llist -> dtor ) {
llist -> dtor ( head TSRMLS_CC ) ;
}
head -> data = NULL ;
SPL_LLIST_DELREF ( head ) ;
return data ;
}
|
27
| 0
|
static void check_initial_width ( VP9_COMP * cpi , int subsampling_x , int subsampling_y ) {
VP9_COMMON * const cm = & cpi -> common ;
if ( ! cpi -> initial_width ) {
cm -> subsampling_x = subsampling_x ;
cm -> subsampling_y = subsampling_y ;
alloc_raw_frame_buffers ( cpi ) ;
alloc_ref_frame_buffers ( cpi ) ;
alloc_util_frame_buffers ( cpi ) ;
init_motion_estimation ( cpi ) ;
cpi -> initial_width = cm -> width ;
cpi -> initial_height = cm -> height ;
}
}
|
28
| 0
|
int http_hdr_print ( HdrHeap * heap , HTTPHdrImpl * hdr , char * buf , int bufsize , int * bufindex , int * dumpoffset ) {
# define TRY ( x ) if ( ! x ) return 0 int tmplen , hdrstat ;
char tmpbuf [ 32 ] ;
char * p ;
ink_assert ( ( hdr -> m_polarity == HTTP_TYPE_REQUEST ) || ( hdr -> m_polarity == HTTP_TYPE_RESPONSE ) ) ;
if ( hdr -> m_polarity == HTTP_TYPE_REQUEST ) {
if ( hdr -> u . req . m_ptr_method == nullptr ) {
return 1 ;
}
if ( ( buf != nullptr ) && ( * dumpoffset == 0 ) && ( bufsize - * bufindex >= hdr -> u . req . m_len_method + 1 ) ) {
p = buf + * bufindex ;
memcpy ( p , hdr -> u . req . m_ptr_method , hdr -> u . req . m_len_method ) ;
p += hdr -> u . req . m_len_method ;
* p ++ = ' ' ;
* bufindex += hdr -> u . req . m_len_method + 1 ;
if ( hdr -> u . req . m_url_impl ) {
TRY ( url_print ( hdr -> u . req . m_url_impl , buf , bufsize , bufindex , dumpoffset ) ) ;
if ( bufsize - * bufindex >= 1 ) {
if ( hdr -> u . req . m_method_wks_idx == HTTP_WKSIDX_CONNECT ) {
* bufindex -= 1 ;
}
p = buf + * bufindex ;
* p ++ = ' ' ;
* bufindex += 1 ;
}
else {
return 0 ;
}
}
if ( bufsize - * bufindex >= 9 ) {
http_hdr_version_to_string ( hdr -> m_version , p ) ;
* bufindex += 9 - 1 ;
}
else {
TRY ( http_version_print ( hdr -> m_version , buf , bufsize , bufindex , dumpoffset ) ) ;
}
if ( bufsize - * bufindex >= 2 ) {
p = buf + * bufindex ;
* p ++ = '\r' ;
* p ++ = '\n' ;
* bufindex += 2 ;
}
else {
TRY ( mime_mem_print ( "\r\n" , 2 , buf , bufsize , bufindex , dumpoffset ) ) ;
}
TRY ( mime_hdr_print ( heap , hdr -> m_fields_impl , buf , bufsize , bufindex , dumpoffset ) ) ;
}
else {
TRY ( mime_mem_print ( hdr -> u . req . m_ptr_method , hdr -> u . req . m_len_method , buf , bufsize , bufindex , dumpoffset ) ) ;
TRY ( mime_mem_print ( " " , 1 , buf , bufsize , bufindex , dumpoffset ) ) ;
if ( hdr -> u . req . m_url_impl ) {
TRY ( url_print ( hdr -> u . req . m_url_impl , buf , bufsize , bufindex , dumpoffset ) ) ;
TRY ( mime_mem_print ( " " , 1 , buf , bufsize , bufindex , dumpoffset ) ) ;
}
TRY ( http_version_print ( hdr -> m_version , buf , bufsize , bufindex , dumpoffset ) ) ;
TRY ( mime_mem_print ( "\r\n" , 2 , buf , bufsize , bufindex , dumpoffset ) ) ;
TRY ( mime_hdr_print ( heap , hdr -> m_fields_impl , buf , bufsize , bufindex , dumpoffset ) ) ;
}
}
else {
if ( ( buf != nullptr ) && ( * dumpoffset == 0 ) && ( bufsize - * bufindex >= 9 + 6 + 1 ) ) {
p = buf + * bufindex ;
http_hdr_version_to_string ( hdr -> m_version , p ) ;
p += 8 ;
* p ++ = ' ' ;
* bufindex += 9 ;
hdrstat = http_hdr_status_get ( hdr ) ;
if ( hdrstat == 200 ) {
* p ++ = '2' ;
* p ++ = '0' ;
* p ++ = '0' ;
tmplen = 3 ;
}
else {
tmplen = mime_format_int ( p , hdrstat , ( bufsize - ( p - buf ) ) ) ;
ink_assert ( tmplen <= 6 ) ;
p += tmplen ;
}
* p ++ = ' ' ;
* bufindex += tmplen + 1 ;
if ( hdr -> u . resp . m_ptr_reason ) {
TRY ( mime_mem_print ( hdr -> u . resp . m_ptr_reason , hdr -> u . resp . m_len_reason , buf , bufsize , bufindex , dumpoffset ) ) ;
}
if ( bufsize - * bufindex >= 2 ) {
p = buf + * bufindex ;
* p ++ = '\r' ;
* p ++ = '\n' ;
* bufindex += 2 ;
}
else {
TRY ( mime_mem_print ( "\r\n" , 2 , buf , bufsize , bufindex , dumpoffset ) ) ;
}
TRY ( mime_hdr_print ( heap , hdr -> m_fields_impl , buf , bufsize , bufindex , dumpoffset ) ) ;
}
else {
TRY ( http_version_print ( hdr -> m_version , buf , bufsize , bufindex , dumpoffset ) ) ;
TRY ( mime_mem_print ( " " , 1 , buf , bufsize , bufindex , dumpoffset ) ) ;
tmplen = mime_format_int ( tmpbuf , http_hdr_status_get ( hdr ) , sizeof ( tmpbuf ) ) ;
TRY ( mime_mem_print ( tmpbuf , tmplen , buf , bufsize , bufindex , dumpoffset ) ) ;
TRY ( mime_mem_print ( " " , 1 , buf , bufsize , bufindex , dumpoffset ) ) ;
if ( hdr -> u . resp . m_ptr_reason ) {
TRY ( mime_mem_print ( hdr -> u . resp . m_ptr_reason , hdr -> u . resp . m_len_reason , buf , bufsize , bufindex , dumpoffset ) ) ;
}
TRY ( mime_mem_print ( "\r\n" , 2 , buf , bufsize , bufindex , dumpoffset ) ) ;
TRY ( mime_hdr_print ( heap , hdr -> m_fields_impl , buf , bufsize , bufindex , dumpoffset ) ) ;
}
}
return 1 ;
# undef TRY }
|
29
| 0
|
static int read_pgpcrt_cn ( server_rec * s , apr_pool_t * p , gnutls_openpgp_crt_t cert , char * * cert_cn ) {
int rv = 0 ;
size_t data_len ;
_gnutls_log ( debug_log_fp , "%s: %d\n" , __func__ , __LINE__ ) ;
* cert_cn = NULL ;
data_len = 0 ;
rv = gnutls_openpgp_crt_get_name ( cert , 0 , NULL , & data_len ) ;
if ( rv == GNUTLS_E_SHORT_MEMORY_BUFFER && data_len > 1 ) {
* cert_cn = apr_palloc ( p , data_len ) ;
rv = gnutls_openpgp_crt_get_name ( cert , 0 , * cert_cn , & data_len ) ;
}
else {
ap_log_error ( APLOG_MARK , APLOG_INFO , 0 , s , "No name found in PGP certificate for '%s:%d'." , s -> server_hostname , s -> port ) ;
}
return rv ;
}
|
30
| 0
|
static int dissect_btgatt_microbit_client_requirements ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , void * data ) {
btatt_data_t * att_data = ( btatt_data_t * ) data ;
if ( bluetooth_gatt_has_no_parameter ( att_data -> opcode ) ) return - 1 ;
proto_tree_add_item ( tree , hf_gatt_microbit_client_requirements , tvb , 0 , tvb_captured_length ( tvb ) , ENC_NA ) ;
return tvb_captured_length ( tvb ) ;
}
|
31
| 0
|
IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , SameUrlNavigation ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
auto waiter = CreatePageLoadMetricsWaiter ( ) ;
waiter -> AddPageExpectation ( TimingField : : FIRST_LAYOUT ) ;
waiter -> AddPageExpectation ( TimingField : : LOAD_EVENT ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/title1.html" ) ) ;
waiter -> Wait ( ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramDomContentLoaded , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramLoad , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstLayout , 1 ) ;
waiter = CreatePageLoadMetricsWaiter ( ) ;
waiter -> AddPageExpectation ( TimingField : : FIRST_LAYOUT ) ;
waiter -> AddPageExpectation ( TimingField : : LOAD_EVENT ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/title1.html" ) ) ;
waiter -> Wait ( ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramDomContentLoaded , 2 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramLoad , 2 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstLayout , 2 ) ;
}
|
32
| 0
|
TEST ( URLFixerTest , FixupFile ) {
base : : ScopedTempDir temp_dir_ ;
ASSERT_TRUE ( temp_dir_ . CreateUniqueTempDir ( ) ) ;
base : : FilePath original ;
ASSERT_TRUE ( MakeTempFile ( temp_dir_ . GetPath ( ) , base : : FilePath ( FILE_PATH_LITERAL ( "url fixer upper existing file.txt" ) ) , & original ) ) ;
GURL golden ( net : : FilePathToFileURL ( original ) ) ;
GURL fixedup ( url_formatter : : FixupURL ( original . AsUTF8Unsafe ( ) , std : : string ( ) ) ) ;
EXPECT_EQ ( golden , fixedup ) ;
# if defined ( OS_WIN ) std : : string cur ( base : : WideToUTF8 ( original . value ( ) ) ) ;
EXPECT_EQ ( ':' , cur [ 1 ] ) ;
cur [ 1 ] = '|' ;
EXPECT_EQ ( golden , url_formatter : : FixupURL ( cur , std : : string ( ) ) ) ;
FixupCase cases [ ] = {
{
"c:\\Non-existent%20file.txt" , "file:///C:/Non-existent%2520file.txt" }
, {
"\\\\NonexistentHost\\foo\\bar.txt" , "file:/onexistenthost/foo/bar.txt" }
, {
"//NonexistentHost\\foo/bar.txt" , "http:/onexistenthost/foo/bar.txt" }
, {
"file:///C:/foo/bar" , "file:///C:/foo/bar" }
, {
"file://C:/foo/bar" , "file:///C:/foo/bar" }
, {
"file:c:" , "file:///C:/" }
, {
"file:c:WINDOWS" , "file:///C:/WINDOWS" }
, {
"file:c|Program Files" , "file:///C:/Program%20Files" }
, {
"file:/file" , "file://file/" }
, {
"file:////////c:\\foo" , "file:///C:/foo" }
, {
"file://server/folder/file" , "file://server/folder/file" }
, }
;
# elif defined ( OS_POSIX ) # if defined ( OS_MACOSX ) # define HOME "/Users/" # else # define HOME "/home/" # endif url_formatter : : home_directory_override = "/foo" ;
FixupCase cases [ ] = {
{
"/A%20non-existent file.txt" , "file:///A%2520non-existent%20file.txt" }
, {
"/" , "file:///" }
, {
"~" , "file:///foo" }
, {
"~/bar" , "file:///foo/bar" }
, {
"~foo" , "file://" HOME "foo" }
, {
"~x/blah" , "file://" HOME "x/blah" }
, }
;
# endif for ( size_t i = 0 ;
i < arraysize ( cases ) ;
i ++ ) {
EXPECT_EQ ( cases [ i ] . output , url_formatter : : FixupURL ( cases [ i ] . input , std : : string ( ) ) . possibly_invalid_spec ( ) ) ;
}
EXPECT_TRUE ( base : : DeleteFile ( original , false ) ) ;
}
|
33
| 0
|
void vp9_init_second_pass ( VP9_COMP * cpi ) {
SVC * const svc = & cpi -> svc ;
const VP9EncoderConfig * const oxcf = & cpi -> oxcf ;
const int is_two_pass_svc = ( svc -> number_spatial_layers > 1 ) || ( svc -> number_temporal_layers > 1 ) ;
TWO_PASS * const twopass = is_two_pass_svc ? & svc -> layer_context [ svc -> spatial_layer_id ] . twopass : & cpi -> twopass ;
double frame_rate ;
FIRSTPASS_STATS * stats ;
zero_stats ( & twopass -> total_stats ) ;
zero_stats ( & twopass -> total_left_stats ) ;
if ( ! twopass -> stats_in_end ) return ;
stats = & twopass -> total_stats ;
* stats = * twopass -> stats_in_end ;
twopass -> total_left_stats = * stats ;
frame_rate = 10000000.0 * stats -> count / stats -> duration ;
if ( is_two_pass_svc ) {
vp9_update_spatial_layer_framerate ( cpi , frame_rate ) ;
twopass -> bits_left = ( int64_t ) ( stats -> duration * svc -> layer_context [ svc -> spatial_layer_id ] . target_bandwidth / 10000000.0 ) ;
}
else {
vp9_new_framerate ( cpi , frame_rate ) ;
twopass -> bits_left = ( int64_t ) ( stats -> duration * oxcf -> target_bandwidth / 10000000.0 ) ;
}
twopass -> sr_update_lag = 1 ;
{
const double avg_error = stats -> coded_error / DOUBLE_DIVIDE_CHECK ( stats -> count ) ;
const FIRSTPASS_STATS * s = twopass -> stats_in ;
double modified_error_total = 0.0 ;
twopass -> modified_error_min = ( avg_error * oxcf -> two_pass_vbrmin_section ) / 100 ;
twopass -> modified_error_max = ( avg_error * oxcf -> two_pass_vbrmax_section ) / 100 ;
while ( s < twopass -> stats_in_end ) {
modified_error_total += calculate_modified_err ( twopass , oxcf , s ) ;
++ s ;
}
twopass -> modified_error_left = modified_error_total ;
}
cpi -> rc . vbr_bits_off_target = 0 ;
twopass -> kf_zeromotion_pct = 100 ;
twopass -> last_kfgroup_zeromotion_pct = 100 ;
}
|
34
| 0
|
static int parse_CBaseStorageVariant ( tvbuff_t * tvb , packet_info * pinfo , int offset , proto_tree * parent_tree , proto_tree * pad_tree _U_ , struct CBaseStorageVariant * value , const char * text ) {
int i , len ;
proto_item * ti , * ti_type , * ti_val ;
proto_tree * tree , * tr ;
enum vType highType ;
ZERO_STRUCT ( * value ) ;
tree = proto_tree_add_subtree ( parent_tree , tvb , offset , 0 , ett_CBaseStorageVariant , & ti , text ) ;
value -> vType = tvb_get_letohs ( tvb , offset ) ;
value -> type = vType_get_type ( value -> vType & 0xFF ) ;
if ( value -> type == NULL ) {
ti_type = proto_tree_add_string ( tree , hf_mswsp_cbasestorvariant_vtype , tvb , offset , 2 , "Unknown CBaseStorageVariant type" ) ;
offset += 2 ;
expert_add_info ( pinfo , ti_type , & ei_mswsp_invalid_variant_type ) ;
THROW_MESSAGE ( ReportedBoundsError , "Unknown CBaseStorageVariant type" ) ;
return offset ;
}
ti_type = proto_tree_add_string ( tree , hf_mswsp_cbasestorvariant_vtype , tvb , offset , 2 , value -> type -> str ) ;
offset += 2 ;
value -> vData1 = tvb_get_guint8 ( tvb , offset ) ;
proto_tree_add_uint ( tree , hf_mswsp_cbasestorvariant_vdata1 , tvb , offset , 1 , value -> vData1 ) ;
offset += 1 ;
value -> vData2 = tvb_get_guint8 ( tvb , offset ) ;
proto_tree_add_uint ( tree , hf_mswsp_cbasestorvariant_vdata2 , tvb , offset , 1 , value -> vData2 ) ;
offset += 1 ;
highType = ( enum vType ) ( value -> vType & 0xFF00 ) ;
ti_val = proto_tree_add_string ( tree , hf_mswsp_cbasestorvariant_vvalue , tvb , offset , 0 , "" ) ;
switch ( highType ) {
case VT_EMPTY : DISSECTOR_ASSERT_HINT ( value -> type -> tvb_get != 0 , "type that we don't know yet how to handle, please submit a bug with trace" ) ;
len = value -> type -> tvb_get ( tvb , offset , & value -> vValue . vt_single ) ;
offset += len ;
break ;
case VT_VECTOR : proto_item_append_text ( ti_type , "|VT_VECTOR" ) ;
tr = proto_item_add_subtree ( ti_val , ett_CBaseStorageVariant_Vector ) ;
len = vvalue_tvb_vector ( tvb , offset , & value -> vValue . vt_vector , value -> type ) ;
proto_tree_add_uint ( tr , hf_mswsp_cbasestorvariant_num , tvb , offset , 4 , value -> vValue . vt_vector . len ) ;
offset += len ;
break ;
case VT_ARRAY : {
guint16 cDims , fFeatures ;
guint32 cbElements , cElements , lLbound ;
int num = 1 ;
proto_item_append_text ( ti_type , "|VT_ARRAY" ) ;
tr = proto_item_add_subtree ( ti_val , ett_CBaseStorageVariant_Array ) ;
cDims = tvb_get_letohs ( tvb , offset ) ;
proto_tree_add_uint ( tr , hf_mswsp_cbasestorvariant_cdims , tvb , offset , 2 , cDims ) ;
offset += 2 ;
fFeatures = tvb_get_letohs ( tvb , offset ) ;
proto_tree_add_uint ( tr , hf_mswsp_cbasestorvariant_ffeatures , tvb , offset , 2 , fFeatures ) ;
offset += 2 ;
cbElements = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_uint ( tr , hf_mswsp_cbasestorvariant_cbelements , tvb , offset , 4 , cbElements ) ;
offset += 4 ;
for ( i = 0 ;
i < cDims ;
i ++ ) {
cElements = tvb_get_letohl ( tvb , offset ) ;
lLbound = tvb_get_letohl ( tvb , offset + 4 ) ;
proto_tree_add_string_format ( tr , hf_mswsp_cbasestorvariant_rgsabound , tvb , offset , 8 , "" , "Rgsabound[%d]: (%d:%d)" , i , cElements , lLbound ) ;
offset += 8 ;
num *= cElements ;
}
len = vvalue_tvb_vector_internal ( tvb , offset , & value -> vValue . vt_array . vData , value -> type , num ) ;
offset += len ;
break ;
}
default : proto_item_append_text ( ti_type , "|0x%x" , highType ) ;
}
proto_item_set_end ( ti , tvb , offset ) ;
proto_item_set_end ( ti_val , tvb , offset ) ;
proto_item_append_text ( ti_val , " %s" , str_CBaseStorageVariant ( value , FALSE ) ) ;
proto_item_append_text ( ti , " %s" , str_CBaseStorageVariant ( value , TRUE ) ) ;
return offset ;
}
|
35
| 0
|
int dissect_ber_constrained_integer64 ( gboolean implicit_tag , asn1_ctx_t * actx , proto_tree * tree , tvbuff_t * tvb , int offset , gint64 min_len , gint64 max_len , gint hf_id , gint64 * value ) {
gint64 val ;
offset = dissect_ber_integer64 ( implicit_tag , actx , tree , tvb , offset , hf_id , & val ) ;
if ( value ) {
* value = val ;
}
ber_check_value64 ( val , min_len , max_len , actx , actx -> created_item ) ;
return offset ;
}
|
36
| 1
|
static void hscroll ( AVCodecContext * avctx ) {
AnsiContext * s = avctx -> priv_data ;
int i ;
if ( s -> y < avctx -> height - s -> font_height ) {
s -> y += s -> font_height ;
return ;
}
i = 0 ;
for ( ;
i < avctx -> height - s -> font_height ;
i ++ ) memcpy ( s -> frame . data [ 0 ] + i * s -> frame . linesize [ 0 ] , s -> frame . data [ 0 ] + ( i + s -> font_height ) * s -> frame . linesize [ 0 ] , avctx -> width ) ;
for ( ;
i < avctx -> height ;
i ++ ) memset ( s -> frame . data [ 0 ] + i * s -> frame . linesize [ 0 ] , DEFAULT_BG_COLOR , avctx -> width ) ;
}
|
37
| 0
|
int EvaluatePS ( char * str , real * stack , int size ) {
EntityChar ec ;
RetStack rs ;
memset ( & ec , '\0' , sizeof ( ec ) ) ;
memset ( & rs , '\0' , sizeof ( rs ) ) ;
rs . max = size ;
rs . stack = stack ;
InterpretPS ( NULL , str , & ec , & rs ) ;
return ( rs . cnt ) ;
}
|
38
| 0
|
static void * pool_calloc ( size_t count , size_t size ) {
size_t len = count * size ;
void * r = pool_alloc ( len ) ;
memset ( r , 0 , len ) ;
return r ;
}
|
39
| 0
|
void luaD_reallocCI ( lua_State * L , int newsize ) {
CallInfo * oldci = L -> base_ci ;
luaM_reallocvector ( L , L -> base_ci , L -> size_ci , newsize , CallInfo ) ;
L -> size_ci = newsize ;
L -> ci = ( L -> ci - oldci ) + L -> base_ci ;
L -> end_ci = L -> base_ci + L -> size_ci - 1 ;
}
|
40
| 0
|
static void intra_pred_plane ( uint8_t * d , uint8_t * top , uint8_t * left , int stride ) {
int x , y , ia ;
int ih = 0 ;
int iv = 0 ;
uint8_t * cm = ff_cropTbl + MAX_NEG_CROP ;
for ( x = 0 ;
x < 4 ;
x ++ ) {
ih += ( x + 1 ) * ( top [ 5 + x ] - top [ 3 - x ] ) ;
iv += ( x + 1 ) * ( left [ 5 + x ] - left [ 3 - x ] ) ;
}
ia = ( top [ 8 ] + left [ 8 ] ) << 4 ;
ih = ( 17 * ih + 16 ) >> 5 ;
iv = ( 17 * iv + 16 ) >> 5 ;
for ( y = 0 ;
y < 8 ;
y ++ ) for ( x = 0 ;
x < 8 ;
x ++ ) d [ y * stride + x ] = cm [ ( ia + ( x - 3 ) * ih + ( y - 3 ) * iv + 16 ) >> 5 ] ;
}
|
41
| 0
|
static void set_v8086_seg ( struct kvm_segment * lhs , const SegmentCache * rhs ) {
lhs -> selector = rhs -> selector ;
lhs -> base = rhs -> base ;
lhs -> limit = rhs -> limit ;
lhs -> type = 3 ;
lhs -> present = 1 ;
lhs -> dpl = 3 ;
lhs -> db = 0 ;
lhs -> s = 1 ;
lhs -> l = 0 ;
lhs -> g = 0 ;
lhs -> avl = 0 ;
lhs -> unusable = 0 ;
}
|
42
| 0
|
afs_int32 SPR_ListEntries ( struct rx_call * call , afs_int32 flag , afs_int32 startindex , prentries * bulkentries , afs_int32 * nextstartindex ) {
afs_int32 code ;
afs_int32 cid = ANONYMOUSID ;
code = listEntries ( call , flag , startindex , bulkentries , nextstartindex , & cid ) ;
osi_auditU ( call , PTS_LstEntsEvent , code , AUD_LONG , flag , AUD_END ) ;
ViceLog ( 125 , ( "PTS_ListEntries: code %d cid %d flag %d\n" , code , cid , flag ) ) ;
return code ;
}
|
43
| 0
|
static vpx_codec_err_t ctrl_use_reference ( vpx_codec_alg_priv_t * ctx , va_list args ) {
const int reference_flag = va_arg ( args , int ) ;
vp9_use_as_reference ( ctx -> cpi , reference_flag ) ;
return VPX_CODEC_OK ;
}
|
44
| 0
|
extern int name ( int ) __THROW __exctype ( isalnum ) ;
__exctype ( isalpha ) ;
__exctype ( iscntrl ) ;
__exctype ( isdigit ) ;
__exctype ( islower ) ;
__exctype ( isgraph ) ;
__exctype ( isprint ) ;
__exctype ( ispunct ) ;
__exctype ( isspace ) ;
__exctype ( isupper ) ;
__exctype ( isxdigit ) ;
extern int tolower ( int __c ) __THROW ;
extern int toupper ( int __c ) __THROW ;
# ifdef __USE_ISOC99 __exctype ( isblank )
|
45
| 0
|
void TSStatIntIncrement ( int id , TSMgmtInt amount ) {
sdk_assert ( sdk_sanity_check_stat_id ( id ) == TS_SUCCESS ) ;
RecIncrRawStat ( api_rsb , nullptr , id , amount ) ;
}
|
46
| 0
|
static int proc_unlinkurb ( struct usb_dev_state * ps , void __user * arg ) {
struct urb * urb ;
struct async * as ;
unsigned long flags ;
spin_lock_irqsave ( & ps -> lock , flags ) ;
as = async_getpending ( ps , arg ) ;
if ( ! as ) {
spin_unlock_irqrestore ( & ps -> lock , flags ) ;
return - EINVAL ;
}
urb = as -> urb ;
usb_get_urb ( urb ) ;
spin_unlock_irqrestore ( & ps -> lock , flags ) ;
usb_kill_urb ( urb ) ;
usb_put_urb ( urb ) ;
return 0 ;
}
|
47
| 0
|
static int decode_argb_frame ( CLLCContext * ctx , GetBitContext * gb , AVFrame * pic ) {
AVCodecContext * avctx = ctx -> avctx ;
uint8_t * dst ;
int pred [ 4 ] ;
int ret ;
int i , j ;
VLC vlc [ 4 ] ;
pred [ 0 ] = 0 ;
pred [ 1 ] = 0x80 ;
pred [ 2 ] = 0x80 ;
pred [ 3 ] = 0x80 ;
dst = pic -> data [ 0 ] ;
skip_bits ( gb , 16 ) ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
ret = read_code_table ( ctx , gb , & vlc [ i ] ) ;
if ( ret < 0 ) {
for ( j = 0 ;
j <= i ;
j ++ ) ff_free_vlc ( & vlc [ j ] ) ;
av_log ( ctx -> avctx , AV_LOG_ERROR , "Could not read code table %d.\n" , i ) ;
return ret ;
}
}
for ( i = 0 ;
i < avctx -> height ;
i ++ ) {
read_argb_line ( ctx , gb , pred , vlc , dst ) ;
dst += pic -> linesize [ 0 ] ;
}
for ( i = 0 ;
i < 4 ;
i ++ ) ff_free_vlc ( & vlc [ i ] ) ;
return 0 ;
}
|
48
| 0
|
static void pk_transaction_class_init ( PkTransactionClass * klass ) {
GObjectClass * object_class = G_OBJECT_CLASS ( klass ) ;
object_class -> dispose = pk_transaction_dispose ;
object_class -> finalize = pk_transaction_finalize ;
signals [ SIGNAL_FINISHED ] = g_signal_new ( "finished" , G_TYPE_FROM_CLASS ( object_class ) , G_SIGNAL_RUN_LAST , 0 , NULL , NULL , g_cclosure_marshal_VOID__VOID , G_TYPE_NONE , 0 ) ;
signals [ SIGNAL_STATE_CHANGED ] = g_signal_new ( "state-changed" , G_TYPE_FROM_CLASS ( object_class ) , G_SIGNAL_RUN_LAST , 0 , NULL , NULL , g_cclosure_marshal_VOID__UINT , G_TYPE_NONE , 1 , G_TYPE_UINT ) ;
signals [ SIGNAL_ALLOW_CANCEL_CHANGED ] = g_signal_new ( "allow-cancel-changed" , G_TYPE_FROM_CLASS ( object_class ) , G_SIGNAL_RUN_LAST , 0 , NULL , NULL , g_cclosure_marshal_VOID__UINT , G_TYPE_NONE , 1 , G_TYPE_UINT ) ;
g_type_class_add_private ( klass , sizeof ( PkTransactionPrivate ) ) ;
}
|
49
| 0
|
static void sig_nick_changed ( CHANNEL_REC * channel , NICK_REC * nick , const char * oldnick ) {
MODULE_CHANNEL_REC * mchannel ;
LAST_MSG_REC * rec ;
mchannel = MODULE_DATA ( channel ) ;
rec = last_msg_find ( mchannel -> lastmsgs , oldnick ) ;
if ( rec != NULL ) {
g_free ( rec -> nick ) ;
rec -> nick = g_strdup ( nick -> nick ) ;
}
}
|
50
| 0
|
TSAction TSCacheWrite ( TSCont contp , TSCacheKey key ) {
sdk_assert ( sdk_sanity_check_iocore_structure ( contp ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_cachekey ( key ) == TS_SUCCESS ) ;
FORCE_PLUGIN_SCOPED_MUTEX ( contp ) ;
CacheInfo * info = ( CacheInfo * ) key ;
Continuation * i = ( INKContInternal * ) contp ;
return ( TSAction ) cacheProcessor . open_write ( i , & info -> cache_key , true , info -> frag_type , 0 , false , info -> pin_in_cache , info -> hostname , info -> len ) ;
}
|
51
| 0
|
static char * _zip_readfpstr ( FILE * fp , unsigned int len , int nulp , struct zip_error * error ) {
char * r , * o ;
r = ( char * ) malloc ( nulp ? len + 1 : len ) ;
if ( ! r ) {
_zip_error_set ( error , ZIP_ER_MEMORY , 0 ) ;
return NULL ;
}
if ( fread ( r , 1 , len , fp ) < len ) {
free ( r ) ;
_zip_error_set ( error , ZIP_ER_READ , errno ) ;
return NULL ;
}
if ( nulp ) {
r [ len ] = 0 ;
for ( o = r ;
o < r + len ;
o ++ ) if ( * o == '\0' ) * o = ' ' ;
}
return r ;
}
|
52
| 0
|
TSReturnCode TSTextLogObjectCreate ( const char * filename , int mode , TSTextLogObject * new_object ) {
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) filename ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) new_object ) == TS_SUCCESS ) ;
if ( mode < 0 || mode >= TS_LOG_MODE_INVALID_FLAG ) {
* new_object = nullptr ;
return TS_ERROR ;
}
TextLogObject * tlog = new TextLogObject ( filename , Log : : config -> logfile_dir , ( bool ) mode & TS_LOG_MODE_ADD_TIMESTAMP , nullptr , Log : : config -> rolling_enabled , Log : : config -> collation_preproc_threads , Log : : config -> rolling_interval_sec , Log : : config -> rolling_offset_hr , Log : : config -> rolling_size_mb ) ;
if ( tlog == nullptr ) {
* new_object = nullptr ;
return TS_ERROR ;
}
int err = ( mode & TS_LOG_MODE_DO_NOT_RENAME ? Log : : config -> log_object_manager . manage_api_object ( tlog , 0 ) : Log : : config -> log_object_manager . manage_api_object ( tlog ) ) ;
if ( err != LogObjectManager : : NO_FILENAME_CONFLICTS ) {
delete tlog ;
* new_object = nullptr ;
return TS_ERROR ;
}
* new_object = ( TSTextLogObject ) tlog ;
return TS_SUCCESS ;
}
|
53
| 0
|
static uint8_t vble_read_reverse_unary ( GetBitContext * gb ) {
uint8_t val = show_bits ( gb , 8 ) ;
if ( val ) {
val = 7 - av_log2_16bit ( ff_reverse [ val ] ) ;
skip_bits ( gb , val + 1 ) ;
return val ;
}
else {
skip_bits ( gb , 8 ) ;
if ( get_bits1 ( gb ) ) return 8 ;
}
return UINT8_MAX ;
}
|
54
| 0
|
static int dissect_h245_T_subPictureRemovalParameters ( 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_subPictureRemovalParameters , T_subPictureRemovalParameters_sequence ) ;
return offset ;
}
|
55
| 0
|
static int dtls1_add_cert_to_buf ( BUF_MEM * buf , unsigned long * l , X509 * x ) {
int n ;
unsigned char * p ;
n = i2d_X509 ( x , NULL ) ;
if ( ! BUF_MEM_grow_clean ( buf , ( int ) ( n + ( * l ) + 3 ) ) ) {
SSLerr ( SSL_F_DTLS1_ADD_CERT_TO_BUF , ERR_R_BUF_LIB ) ;
return 0 ;
}
p = ( unsigned char * ) & ( buf -> data [ * l ] ) ;
l2n3 ( n , p ) ;
i2d_X509 ( x , & p ) ;
* l += n + 3 ;
return 1 ;
}
|
56
| 0
|
void dwarf_elf_object_access_finish ( Dwarf_Obj_Access_Interface * obj ) {
if ( ! obj ) {
return ;
}
if ( obj -> object ) {
dwarf_elf_object_access_internals_t * internals = ( dwarf_elf_object_access_internals_t * ) obj -> object ;
if ( internals -> libdwarf_owns_elf ) {
elf_end ( internals -> elf ) ;
}
}
free ( obj -> object ) ;
free ( obj ) ;
}
|
57
| 1
|
IN_PROC_BROWSER_TEST_F ( AppApiTest , DISABLED_AppProcess ) {
LOG ( INFO ) << "Start of test." ;
extensions : : ProcessMap * process_map = extensions : : ProcessMap : : Get ( browser ( ) -> profile ( ) ) ;
ASSERT_TRUE ( LoadExtension ( test_data_dir_ . AppendASCII ( "app_process" ) ) ) ;
LOG ( INFO ) << "Loaded extension." ;
GURL base_url = GetTestBaseURL ( "app_process" ) ;
ui_test_utils : : NavigateToURLWithDisposition ( browser ( ) , base_url . Resolve ( "path1/empty.html" ) , WindowOpenDisposition : : NEW_FOREGROUND_TAB , ui_test_utils : : BROWSER_TEST_WAIT_FOR_NAVIGATION ) ;
EXPECT_TRUE ( process_map -> Contains ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 1 ) -> GetRenderProcessHost ( ) -> GetID ( ) ) ) ;
EXPECT_FALSE ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 1 ) -> GetWebUI ( ) ) ;
LOG ( INFO ) << "Nav 1." ;
ui_test_utils : : NavigateToURLWithDisposition ( browser ( ) , base_url . Resolve ( "path2/empty.html" ) , WindowOpenDisposition : : NEW_FOREGROUND_TAB , ui_test_utils : : BROWSER_TEST_WAIT_FOR_NAVIGATION ) ;
EXPECT_TRUE ( process_map -> Contains ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 2 ) -> GetRenderProcessHost ( ) -> GetID ( ) ) ) ;
EXPECT_FALSE ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 2 ) -> GetWebUI ( ) ) ;
LOG ( INFO ) << "Nav 2." ;
content : : WindowedNotificationObserver tab_added_observer ( chrome : : NOTIFICATION_TAB_ADDED , content : : NotificationService : : AllSources ( ) ) ;
chrome : : NewTab ( browser ( ) ) ;
tab_added_observer . Wait ( ) ;
LOG ( INFO ) << "New tab." ;
ui_test_utils : : NavigateToURL ( browser ( ) , base_url . Resolve ( "path3/empty.html" ) ) ;
LOG ( INFO ) << "Nav 3." ;
EXPECT_FALSE ( process_map -> Contains ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 3 ) -> GetRenderProcessHost ( ) -> GetID ( ) ) ) ;
EXPECT_FALSE ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 3 ) -> GetWebUI ( ) ) ;
ASSERT_EQ ( 4 , browser ( ) -> tab_strip_model ( ) -> count ( ) ) ;
WebContents * tab = browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 1 ) ;
EXPECT_EQ ( tab -> GetRenderProcessHost ( ) , browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 2 ) -> GetRenderProcessHost ( ) ) ;
EXPECT_NE ( tab -> GetRenderProcessHost ( ) , browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 3 ) -> GetRenderProcessHost ( ) ) ;
ASSERT_EQ ( 1u , chrome : : GetBrowserCount ( browser ( ) -> profile ( ) ) ) ;
OpenWindow ( tab , base_url . Resolve ( "path1/empty.html" ) , true , NULL ) ;
LOG ( INFO ) << "WindowOpenHelper 1." ;
OpenWindow ( tab , base_url . Resolve ( "path2/empty.html" ) , true , NULL ) ;
LOG ( INFO ) << "WindowOpenHelper 2." ;
OpenWindow ( tab , base_url . Resolve ( "path3/empty.html" ) , true , NULL ) ;
LOG ( INFO ) << "WindowOpenHelper 3." ;
const GURL & app_url ( base_url . Resolve ( "path1/empty.html" ) ) ;
const GURL & non_app_url ( base_url . Resolve ( "path3/empty.html" ) ) ;
NavigateInRenderer ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 2 ) , non_app_url ) ;
LOG ( INFO ) << "NavigateTabHelper 1." ;
NavigateInRenderer ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 3 ) , app_url ) ;
LOG ( INFO ) << "NavigateTabHelper 2." ;
EXPECT_NE ( tab -> GetRenderProcessHost ( ) , browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 2 ) -> GetRenderProcessHost ( ) ) ;
EXPECT_EQ ( tab -> GetRenderProcessHost ( ) , browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 3 ) -> GetRenderProcessHost ( ) ) ;
NavigateInRenderer ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 6 ) , app_url ) ;
LOG ( INFO ) << "NavigateTabHelper 3." ;
EXPECT_EQ ( tab -> GetRenderProcessHost ( ) , browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 6 ) -> GetRenderProcessHost ( ) ) ;
bool windowOpenerValid = false ;
ASSERT_TRUE ( content : : ExecuteScriptAndExtractBool ( browser ( ) -> tab_strip_model ( ) -> GetWebContentsAt ( 6 ) , "window.domAutomationController.send(window.opener != null)" , & windowOpenerValid ) ) ;
ASSERT_TRUE ( windowOpenerValid ) ;
LOG ( INFO ) << "End of test." ;
}
|
58
| 0
|
static int get_hf_elem_id ( int pdu_type ) {
int hf_elem_id = 0 ;
switch ( pdu_type ) {
case GSM_A_PDU_TYPE_BSSMAP : hf_elem_id = hf_gsm_a_bssmap_elem_id ;
break ;
case GSM_A_PDU_TYPE_DTAP : hf_elem_id = hf_gsm_a_dtap_elem_id ;
break ;
case GSM_A_PDU_TYPE_RP : hf_elem_id = hf_gsm_a_rp_elem_id ;
break ;
case GSM_A_PDU_TYPE_RR : hf_elem_id = hf_gsm_a_rr_elem_id ;
break ;
case GSM_A_PDU_TYPE_COMMON : hf_elem_id = hf_gsm_a_common_elem_id ;
break ;
case GSM_A_PDU_TYPE_GM : hf_elem_id = hf_gsm_a_gm_elem_id ;
break ;
case GSM_A_PDU_TYPE_BSSLAP : hf_elem_id = hf_gsm_a_bsslap_elem_id ;
break ;
case GSM_PDU_TYPE_BSSMAP_LE : hf_elem_id = hf_gsm_bssmap_le_elem_id ;
break ;
case NAS_PDU_TYPE_COMMON : hf_elem_id = hf_nas_eps_common_elem_id ;
break ;
case NAS_PDU_TYPE_EMM : hf_elem_id = hf_nas_eps_emm_elem_id ;
break ;
case NAS_PDU_TYPE_ESM : hf_elem_id = hf_nas_eps_esm_elem_id ;
break ;
case SGSAP_PDU_TYPE : hf_elem_id = hf_sgsap_elem_id ;
break ;
case BSSGP_PDU_TYPE : hf_elem_id = hf_bssgp_elem_id ;
break ;
case GMR1_IE_COMMON : case GMR1_IE_RR : hf_elem_id = hf_gmr1_elem_id ;
break ;
default : DISSECTOR_ASSERT_NOT_REACHED ( ) ;
}
return hf_elem_id ;
}
|
59
| 0
|
static int dissect_rsl_ie_rach_load ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , int offset , gboolean is_mandatory ) {
proto_item * ti ;
proto_tree * ie_tree ;
guint length ;
guint8 ie_id ;
int ie_offset ;
if ( is_mandatory == FALSE ) {
ie_id = tvb_get_guint8 ( tvb , offset ) ;
if ( ie_id != RSL_IE_RACH_LOAD ) return offset ;
}
ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_ie_rach_load , & ti , "RACH Load IE " ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
length = tvb_get_guint8 ( tvb , offset ) ;
proto_item_set_len ( ti , length + 2 ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_length , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
ie_offset = offset ;
proto_tree_add_item ( ie_tree , hf_rsl_rach_slot_cnt , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
offset = offset + 2 ;
length = length - 2 ;
proto_tree_add_item ( ie_tree , hf_rsl_rach_busy_cnt , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
offset = offset + 2 ;
length = length - 2 ;
proto_tree_add_item ( ie_tree , hf_rsl_rach_acc_cnt , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
offset = offset + 2 ;
length = length - 2 ;
if ( length > 0 ) {
proto_tree_add_item ( ie_tree , hf_rsl_rach_supplementary_information , tvb , offset , length , ENC_NA ) ;
}
offset = ie_offset + length ;
return offset ;
}
|
60
| 0
|
void simplestring_addn ( simplestring * target , const char * source , size_t add_len ) {
size_t newsize = target -> size , incr = 0 ;
if ( target && source ) {
if ( ! target -> str ) {
simplestring_init_str ( target ) ;
}
if ( ( SIZE_MAX - add_len ) < target -> len || ( SIZE_MAX - add_len - 1 ) < target -> len ) {
return ;
}
if ( target -> len + add_len + 1 > target -> size ) {
newsize = target -> len + add_len + 1 ;
incr = target -> size * 2 ;
if ( incr ) {
newsize = newsize - ( newsize % incr ) + incr ;
}
if ( newsize < ( target -> len + add_len + 1 ) ) {
return ;
}
target -> str = ( char * ) realloc ( target -> str , newsize ) ;
target -> size = target -> str ? newsize : 0 ;
}
if ( target -> str ) {
if ( add_len ) {
memcpy ( target -> str + target -> len , source , add_len ) ;
}
target -> len += add_len ;
target -> str [ target -> len ] = 0 ;
}
}
}
|
61
| 1
|
static int parse_CDbProp ( tvbuff_t * tvb , int offset , proto_tree * parent_tree , proto_tree * pad_tree , struct GuidPropertySet * propset , const char * fmt , ... ) {
static const value_string EMPTY_VS [ ] = {
{
0 , NULL }
}
;
const value_string * vs = ( propset && propset -> id_map ) ? propset -> id_map : EMPTY_VS ;
guint32 id , opt , status ;
struct CBaseStorageVariant value ;
proto_item * item ;
proto_tree * tree ;
const char * str , * 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_CDbProp , & item , txt ) ;
id = tvb_get_letohl ( tvb , offset ) ;
str = val_to_str ( id , vs , "0x%08x" ) ;
proto_tree_add_string_format_value ( tree , hf_mswsp_cdbprop_id , tvb , offset , 4 , str , "%s (0x%08x)" , ( str [ 0 ] == '0' ? "" : str ) , id ) ;
offset += 4 ;
proto_item_append_text ( item , " Id: %s" , str ) ;
opt = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_uint ( tree , hf_mswsp_cdbprop_options , tvb , offset , 4 , opt ) ;
offset += 4 ;
status = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_uint ( tree , hf_mswsp_cdbprop_status , tvb , offset , 4 , status ) ;
offset += 4 ;
offset = parse_CDbColId ( tvb , offset , tree , pad_tree , "colid" ) ;
offset = parse_CBaseStorageVariant ( tvb , offset , tree , pad_tree , & value , "vValue" ) ;
str = str_CBaseStorageVariant ( & value , TRUE ) ;
proto_item_append_text ( item , " %s" , str ) ;
proto_item_set_end ( item , tvb , offset ) ;
return offset ;
}
|
62
| 1
|
static int mjpegb_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
MJpegDecodeContext * s = avctx -> priv_data ;
const uint8_t * buf_end , * buf_ptr ;
AVFrame * picture = data ;
GetBitContext hgb ;
uint32_t dqt_offs , dht_offs , sof_offs , sos_offs , second_field_offs ;
uint32_t field_size , sod_offs ;
buf_ptr = buf ;
buf_end = buf + buf_size ;
read_header : s -> restart_interval = 0 ;
s -> restart_count = 0 ;
s -> mjpb_skiptosod = 0 ;
if ( buf_end - buf_ptr >= 1 << 28 ) return AVERROR_INVALIDDATA ;
init_get_bits ( & hgb , buf_ptr , ( buf_end - buf_ptr ) * 8 ) ;
skip_bits ( & hgb , 32 ) ;
if ( get_bits_long ( & hgb , 32 ) != MKBETAG ( 'm' , 'j' , 'p' , 'g' ) ) {
av_log ( avctx , AV_LOG_WARNING , "not mjpeg-b (bad fourcc)\n" ) ;
return AVERROR_INVALIDDATA ;
}
field_size = get_bits_long ( & hgb , 32 ) ;
av_log ( avctx , AV_LOG_DEBUG , "field size: 0x%x\n" , field_size ) ;
skip_bits ( & hgb , 32 ) ;
second_field_offs = read_offs ( avctx , & hgb , buf_end - buf_ptr , "second_field_offs is %d and size is %d\n" ) ;
av_log ( avctx , AV_LOG_DEBUG , "second field offs: 0x%x\n" , second_field_offs ) ;
dqt_offs = read_offs ( avctx , & hgb , buf_end - buf_ptr , "dqt is %d and size is %d\n" ) ;
av_log ( avctx , AV_LOG_DEBUG , "dqt offs: 0x%x\n" , dqt_offs ) ;
if ( dqt_offs ) {
init_get_bits ( & s -> gb , buf_ptr + dqt_offs , ( buf_end - ( buf_ptr + dqt_offs ) ) * 8 ) ;
s -> start_code = DQT ;
if ( ff_mjpeg_decode_dqt ( s ) < 0 && ( avctx -> err_recognition & AV_EF_EXPLODE ) ) return AVERROR_INVALIDDATA ;
}
dht_offs = read_offs ( avctx , & hgb , buf_end - buf_ptr , "dht is %d and size is %d\n" ) ;
av_log ( avctx , AV_LOG_DEBUG , "dht offs: 0x%x\n" , dht_offs ) ;
if ( dht_offs ) {
init_get_bits ( & s -> gb , buf_ptr + dht_offs , ( buf_end - ( buf_ptr + dht_offs ) ) * 8 ) ;
s -> start_code = DHT ;
ff_mjpeg_decode_dht ( s ) ;
}
sof_offs = read_offs ( avctx , & hgb , buf_end - buf_ptr , "sof is %d and size is %d\n" ) ;
av_log ( avctx , AV_LOG_DEBUG , "sof offs: 0x%x\n" , sof_offs ) ;
if ( sof_offs ) {
init_get_bits ( & s -> gb , buf_ptr + sof_offs , ( buf_end - ( buf_ptr + sof_offs ) ) * 8 ) ;
s -> start_code = SOF0 ;
if ( ff_mjpeg_decode_sof ( s ) < 0 ) return - 1 ;
}
sos_offs = read_offs ( avctx , & hgb , buf_end - buf_ptr , "sos is %d and size is %d\n" ) ;
av_log ( avctx , AV_LOG_DEBUG , "sos offs: 0x%x\n" , sos_offs ) ;
sod_offs = read_offs ( avctx , & hgb , buf_end - buf_ptr , "sof is %d and size is %d\n" ) ;
av_log ( avctx , AV_LOG_DEBUG , "sod offs: 0x%x\n" , sod_offs ) ;
if ( sos_offs ) {
init_get_bits ( & s -> gb , buf_ptr + sos_offs , 8 * FFMIN ( field_size , buf_end - buf_ptr - sos_offs ) ) ;
s -> mjpb_skiptosod = ( sod_offs - sos_offs - show_bits ( & s -> gb , 16 ) ) ;
s -> start_code = SOS ;
if ( ff_mjpeg_decode_sos ( s , NULL , NULL ) < 0 && ( avctx -> err_recognition & AV_EF_EXPLODE ) ) return AVERROR_INVALIDDATA ;
}
if ( s -> interlaced ) {
s -> bottom_field ^= 1 ;
if ( s -> bottom_field != s -> interlace_polarity && second_field_offs ) {
buf_ptr = buf + second_field_offs ;
second_field_offs = 0 ;
goto read_header ;
}
}
* picture = * s -> picture_ptr ;
* got_frame = 1 ;
if ( ! s -> lossless ) {
picture -> quality = FFMAX3 ( s -> qscale [ 0 ] , s -> qscale [ 1 ] , s -> qscale [ 2 ] ) ;
picture -> qstride = 0 ;
picture -> qscale_table = s -> qscale_table ;
memset ( picture -> qscale_table , picture -> quality , ( s -> width + 15 ) / 16 ) ;
if ( avctx -> debug & FF_DEBUG_QP ) av_log ( avctx , AV_LOG_DEBUG , "QP: %d\n" , picture -> quality ) ;
picture -> quality *= FF_QP2LAMBDA ;
}
return buf_size ;
}
|
63
| 0
|
void gx_device_copy_color_params ( gx_device * dev , const gx_device * target ) {
COPY_PARAM ( color_info ) ;
COPY_PARAM ( cached_colors ) ;
gx_device_copy_color_procs ( dev , target ) ;
}
|
64
| 0
|
static void signal_window_item_changed ( WINDOW_REC * window , WI_ITEM_REC * item ) {
g_return_if_fail ( window != NULL ) ;
if ( item == NULL ) return ;
if ( g_slist_length ( window -> items ) > 1 && IS_CHANNEL ( item ) ) {
printformat ( item -> server , item -> visible_name , MSGLEVEL_CLIENTNOTICE , TXT_TALKING_IN , item -> visible_name ) ;
signal_stop ( ) ;
}
}
|
65
| 0
|
static ossl_inline void sk_ ## t1 ## _sort ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_sort ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline int sk_ ## t1 ## _is_sorted ( const STACK_OF ( t1 ) * sk ) {
return OPENSSL_sk_is_sorted ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _dup ( const STACK_OF ( t1 ) * sk ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_dup ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _deep_copy ( const STACK_OF ( t1 ) * sk , sk_ ## t1 ## _copyfunc copyfunc , sk_ ## t1 ## _freefunc freefunc ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_deep_copy ( ( const OPENSSL_STACK * ) sk , ( OPENSSL_sk_copyfunc ) copyfunc , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline sk_ ## t1 ## _compfunc sk_ ## t1 ## _set_cmp_func ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _compfunc compare ) {
return ( sk_ ## t1 ## _compfunc ) OPENSSL_sk_set_cmp_func ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_compfunc ) compare ) ;
}
# define DEFINE_SPECIAL_STACK_OF ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , t2 , t2 ) # define DEFINE_STACK_OF ( t ) SKM_DEFINE_STACK_OF ( t , t , t ) # define DEFINE_SPECIAL_STACK_OF_CONST ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , const t2 , t2 ) # define DEFINE_STACK_OF_CONST ( t ) SKM_DEFINE_STACK_OF ( t , const t , t ) typedef char * OPENSSL_STRING ;
typedef const char * OPENSSL_CSTRING ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_STRING , char )
|
66
| 1
|
int ieee80211_radiotap_iterator_next ( struct ieee80211_radiotap_iterator * iterator ) {
while ( 1 ) {
int hit = 0 ;
int pad , align , size , subns ;
guint32 oui ;
if ( ( iterator -> _arg_index % 32 ) == IEEE80211_RADIOTAP_EXT && ! ( iterator -> _bitmap_shifter & 1 ) ) return - ENOENT ;
if ( ! ( iterator -> _bitmap_shifter & 1 ) ) goto next_entry ;
switch ( iterator -> _arg_index % 32 ) {
case IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE : case IEEE80211_RADIOTAP_EXT : align = 1 ;
size = 0 ;
break ;
case IEEE80211_RADIOTAP_VENDOR_NAMESPACE : align = 2 ;
size = 6 ;
break ;
default : # ifdef RADIOTAP_SUPPORT_OVERRIDES if ( find_override ( iterator , & align , & size ) ) {
}
else # endif if ( ! iterator -> current_namespace || iterator -> _arg_index >= iterator -> current_namespace -> n_bits ) {
if ( iterator -> current_namespace == & radiotap_ns ) return - ENOENT ;
align = 0 ;
}
else {
align = iterator -> current_namespace -> align_size [ iterator -> _arg_index ] . align ;
size = iterator -> current_namespace -> align_size [ iterator -> _arg_index ] . size ;
}
if ( ! align ) {
iterator -> _arg = iterator -> _next_ns_data ;
iterator -> current_namespace = NULL ;
goto next_entry ;
}
break ;
}
pad = ( int ) ( ( iterator -> _arg - ( unsigned char * ) iterator -> _rtheader ) & ( align - 1 ) ) ;
if ( pad ) iterator -> _arg += align - pad ;
if ( iterator -> _arg_index % 32 == IEEE80211_RADIOTAP_VENDOR_NAMESPACE ) {
int vnslen ;
if ( ! ITERATOR_VALID ( iterator , size ) ) return - EINVAL ;
oui = ( * iterator -> _arg << 16 ) | ( * ( iterator -> _arg + 1 ) << 8 ) | * ( iterator -> _arg + 2 ) ;
subns = * ( iterator -> _arg + 3 ) ;
find_ns ( iterator , oui , subns ) ;
vnslen = get_unaligned_le16 ( iterator -> _arg + 4 ) ;
iterator -> _next_ns_data = iterator -> _arg + size + vnslen ;
if ( ! iterator -> current_namespace ) size += vnslen ;
}
iterator -> this_arg_index = iterator -> _arg_index ;
iterator -> this_arg = iterator -> _arg ;
iterator -> this_arg_size = size ;
iterator -> _arg += size ;
if ( ! ITERATOR_VALID ( iterator , 0 ) ) return - EINVAL ;
switch ( iterator -> _arg_index % 32 ) {
case IEEE80211_RADIOTAP_VENDOR_NAMESPACE : iterator -> _reset_on_ext = 1 ;
iterator -> is_radiotap_ns = 0 ;
iterator -> this_arg_index = IEEE80211_RADIOTAP_VENDOR_NAMESPACE ;
if ( ! iterator -> current_namespace ) hit = 1 ;
goto next_entry ;
case IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE : iterator -> _reset_on_ext = 1 ;
iterator -> current_namespace = & radiotap_ns ;
iterator -> is_radiotap_ns = 1 ;
goto next_entry ;
case IEEE80211_RADIOTAP_EXT : iterator -> _bitmap_shifter = get_unaligned_le32 ( iterator -> _next_bitmap ) ;
iterator -> _next_bitmap ++ ;
if ( iterator -> _reset_on_ext ) iterator -> _arg_index = 0 ;
else iterator -> _arg_index ++ ;
iterator -> _reset_on_ext = 0 ;
break ;
default : hit = 1 ;
next_entry : iterator -> _bitmap_shifter >>= 1 ;
iterator -> _arg_index ++ ;
}
if ( hit ) return 0 ;
}
}
|
67
| 0
|
int i2d_RSAPublicKey_bio ( BIO * bp , RSA * rsa ) {
return ASN1_item_i2d_bio ( ASN1_ITEM_rptr ( RSAPublicKey ) , bp , rsa ) ;
}
|
68
| 0
|
static int copy_parameter_set ( void * * to , void * * from , int count , int size ) {
int i ;
for ( i = 0 ;
i < count ;
i ++ ) {
if ( to [ i ] && ! from [ i ] ) {
av_freep ( & to [ i ] ) ;
}
else if ( from [ i ] && ! to [ i ] ) {
to [ i ] = av_malloc ( size ) ;
if ( ! to [ i ] ) return AVERROR ( ENOMEM ) ;
}
if ( from [ i ] ) memcpy ( to [ i ] , from [ i ] , size ) ;
}
return 0 ;
}
|
69
| 0
|
static void U_CALLCONV _UTF16ToUnicodeWithOffsets ( UConverterToUnicodeArgs * pArgs , UErrorCode * pErrorCode ) {
UConverter * cnv = pArgs -> converter ;
const char * source = pArgs -> source ;
const char * sourceLimit = pArgs -> sourceLimit ;
int32_t * offsets = pArgs -> offsets ;
int32_t state , offsetDelta ;
uint8_t b ;
state = cnv -> mode ;
offsetDelta = 0 ;
while ( source < sourceLimit && U_SUCCESS ( * pErrorCode ) ) {
switch ( state ) {
case 0 : cnv -> toUBytes [ 0 ] = ( uint8_t ) * source ++ ;
cnv -> toULength = 1 ;
state = 1 ;
break ;
case 1 : b = * source ;
if ( cnv -> toUBytes [ 0 ] == 0xfe && b == 0xff ) {
if ( IS_UTF16LE ( cnv ) ) {
state = 7 ;
}
else {
state = 8 ;
}
}
else if ( cnv -> toUBytes [ 0 ] == 0xff && b == 0xfe ) {
if ( IS_UTF16BE ( cnv ) ) {
state = 6 ;
}
else {
state = 9 ;
}
}
else if ( ( IS_UTF16 ( cnv ) && UCNV_GET_VERSION ( cnv ) == 1 ) ) {
state = 6 ;
}
if ( state >= 8 ) {
++ source ;
cnv -> toULength = 0 ;
offsetDelta = ( int32_t ) ( source - pArgs -> source ) ;
}
else if ( state < 6 ) {
if ( source != pArgs -> source ) {
source = pArgs -> source ;
cnv -> toULength = 0 ;
}
if ( IS_UTF16LE ( cnv ) ) {
state = 9 ;
}
else {
state = 8 ;
}
}
else {
cnv -> toUBytes [ 1 ] = b ;
cnv -> toULength = 2 ;
pArgs -> source = source + 1 ;
cnv -> mode = state + 2 ;
* pErrorCode = U_ILLEGAL_ESCAPE_SEQUENCE ;
return ;
}
cnv -> mode = state ;
continue ;
case 8 : pArgs -> source = source ;
_UTF16BEToUnicodeWithOffsets ( pArgs , pErrorCode ) ;
source = pArgs -> source ;
break ;
case 9 : pArgs -> source = source ;
_UTF16LEToUnicodeWithOffsets ( pArgs , pErrorCode ) ;
source = pArgs -> source ;
break ;
default : break ;
}
}
if ( offsets != NULL && offsetDelta != 0 ) {
int32_t * offsetsLimit = pArgs -> offsets ;
while ( offsets < offsetsLimit ) {
* offsets ++ += offsetDelta ;
}
}
pArgs -> source = source ;
if ( source == sourceLimit && pArgs -> flush ) {
switch ( state ) {
case 0 : break ;
case 8 : _UTF16BEToUnicodeWithOffsets ( pArgs , pErrorCode ) ;
break ;
case 9 : _UTF16LEToUnicodeWithOffsets ( pArgs , pErrorCode ) ;
break ;
default : break ;
}
}
cnv -> mode = state ;
}
|
70
| 0
|
void dtap_mm_mm_info ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) {
guint32 curr_offset ;
guint32 consumed ;
guint curr_len ;
curr_offset = offset ;
curr_len = len ;
is_uplink = IS_UPLINK_TRUE ;
ELEM_OPT_TLV ( 0x43 , GSM_A_PDU_TYPE_DTAP , DE_NETWORK_NAME , " - Full Name" ) ;
ELEM_OPT_TLV ( 0x45 , GSM_A_PDU_TYPE_DTAP , DE_NETWORK_NAME , " - Short Name" ) ;
ELEM_OPT_TV ( 0x46 , GSM_A_PDU_TYPE_DTAP , DE_TIME_ZONE , " - Local" ) ;
ELEM_OPT_TV ( 0x47 , GSM_A_PDU_TYPE_DTAP , DE_TIME_ZONE_TIME , " - Universal Time and Local Time Zone" ) ;
ELEM_OPT_TLV ( 0x48 , GSM_A_PDU_TYPE_DTAP , DE_LSA_ID , NULL ) ;
ELEM_OPT_TLV ( 0x49 , GSM_A_PDU_TYPE_DTAP , DE_DAY_SAVING_TIME , NULL ) ;
EXTRANEOUS_DATA_CHECK ( curr_len , 0 , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
}
|
71
| 0
|
static void dissect_rsvp_exclude_route ( proto_item * ti , packet_info * pinfo , proto_tree * rsvp_object_tree , tvbuff_t * tvb , int offset , int obj_length , int rsvp_class , int ctype ) {
proto_item_set_text ( ti , "EXCLUDE ROUTE: " ) ;
switch ( ctype ) {
case 1 : proto_tree_add_uint ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , ctype ) ;
dissect_rsvp_xro_subobjects ( ti , pinfo , rsvp_object_tree , tvb , offset + 4 , obj_length , rsvp_class ) ;
break ;
default : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , ctype , "Unknown (%u)" , ctype ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_exclude_route_data , tvb , offset + 4 , obj_length - 4 , ENC_NA ) ;
break ;
}
}
|
72
| 0
|
static inline gsize label_concat ( char * label_str , gsize pos , const char * str ) {
if ( pos < ITEM_LABEL_LENGTH ) pos += g_strlcpy ( label_str + pos , str , ITEM_LABEL_LENGTH - pos ) ;
return pos ;
}
|
73
| 0
|
IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , FirstMeaningfulPaintNotRecorded ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
auto waiter = CreatePageLoadMetricsWaiter ( ) ;
waiter -> AddPageExpectation ( TimingField : : FIRST_CONTENTFUL_PAINT ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/page_load_metrics/page_with_active_connections.html" ) ) ;
waiter -> Wait ( ) ;
NavigateToUntrackedUrl ( ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstContentfulPaint , 1 ) ;
histogram_tester_ . ExpectUniqueSample ( internal : : kHistogramFirstMeaningfulPaintStatus , internal : : FIRST_MEANINGFUL_PAINT_DID_NOT_REACH_NETWORK_STABLE , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstMeaningfulPaint , 0 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramParseStartToFirstMeaningfulPaint , 0 ) ;
}
|
74
| 0
|
static void cluster_one_database ( const char * dbname , bool verbose , const char * table , const char * host , const char * port , const char * username , enum trivalue prompt_password , const char * progname , bool echo ) {
PQExpBufferData sql ;
PGconn * conn ;
initPQExpBuffer ( & sql ) ;
appendPQExpBufferStr ( & sql , "CLUSTER" ) ;
if ( verbose ) appendPQExpBufferStr ( & sql , " VERBOSE" ) ;
if ( table ) appendPQExpBuffer ( & sql , " %s" , table ) ;
appendPQExpBufferChar ( & sql , ';
' ) ;
conn = connectDatabase ( dbname , host , port , username , prompt_password , progname , false , false ) ;
if ( ! executeMaintenanceCommand ( conn , sql . data , echo ) ) {
if ( table ) fprintf ( stderr , _ ( "%s: clustering of table \"%s\" in database \"%s\" failed: %s" ) , progname , table , PQdb ( conn ) , PQerrorMessage ( conn ) ) ;
else fprintf ( stderr , _ ( "%s: clustering of database \"%s\" failed: %s" ) , progname , PQdb ( conn ) , PQerrorMessage ( conn ) ) ;
PQfinish ( conn ) ;
exit ( 1 ) ;
}
PQfinish ( conn ) ;
termPQExpBuffer ( & sql ) ;
}
|
75
| 0
|
static void build_mc_border ( const uint8_t * src , int src_stride , uint8_t * dst , int dst_stride , int x , int y , int b_w , int b_h , int w , int h ) {
const uint8_t * ref_row = src - x - y * src_stride ;
if ( y >= h ) ref_row += ( h - 1 ) * src_stride ;
else if ( y > 0 ) ref_row += y * src_stride ;
do {
int right = 0 , copy ;
int left = x < 0 ? - x : 0 ;
if ( left > b_w ) left = b_w ;
if ( x + b_w > w ) right = x + b_w - w ;
if ( right > b_w ) right = b_w ;
copy = b_w - left - right ;
if ( left ) memset ( dst , ref_row [ 0 ] , left ) ;
if ( copy ) memcpy ( dst + left , ref_row + x + left , copy ) ;
if ( right ) memset ( dst + left + copy , ref_row [ w - 1 ] , right ) ;
dst += dst_stride ;
++ y ;
if ( y > 0 && y < h ) ref_row += src_stride ;
}
while ( -- b_h ) ;
}
|
76
| 1
|
void nautilus_file_mark_desktop_file_trusted ( GFile * file , GtkWindow * parent_window , gboolean interactive , NautilusOpCallback done_callback , gpointer done_callback_data ) {
GTask * task ;
MarkTrustedJob * job ;
job = op_job_new ( MarkTrustedJob , parent_window ) ;
job -> file = g_object_ref ( file ) ;
job -> interactive = interactive ;
job -> done_callback = done_callback ;
job -> done_callback_data = done_callback_data ;
task = g_task_new ( NULL , NULL , mark_trusted_task_done , job ) ;
g_task_set_task_data ( task , job , NULL ) ;
g_task_run_in_thread ( task , mark_trusted_task_thread_func ) ;
g_object_unref ( task ) ;
}
|
77
| 0
|
static TranslationBlock * tb_alloc ( target_ulong pc ) {
TranslationBlock * tb ;
if ( tcg_ctx . tb_ctx . nb_tbs >= tcg_ctx . code_gen_max_blocks || ( tcg_ctx . code_gen_ptr - tcg_ctx . code_gen_buffer ) >= tcg_ctx . code_gen_buffer_max_size ) {
return NULL ;
}
tb = & tcg_ctx . tb_ctx . tbs [ tcg_ctx . tb_ctx . nb_tbs ++ ] ;
tb -> pc = pc ;
tb -> cflags = 0 ;
return tb ;
}
|
78
| 0
|
static void erase_screen ( AVCodecContext * avctx ) {
AnsiContext * s = avctx -> priv_data ;
int i ;
for ( i = 0 ;
i < avctx -> height ;
i ++ ) memset ( s -> frame -> data [ 0 ] + i * s -> frame -> linesize [ 0 ] , DEFAULT_BG_COLOR , avctx -> width ) ;
s -> x = s -> y = 0 ;
}
|
79
| 0
|
void proto_reg_handoff_pvfs ( void ) {
dissector_handle_t pvfs_handle ;
pvfs_handle = create_dissector_handle ( dissect_pvfs_heur , proto_pvfs ) ;
dissector_add_uint_with_preference ( "tcp.port" , TCP_PORT_PVFS2 , pvfs_handle ) ;
heur_dissector_add ( "tcp" , dissect_pvfs_heur , "PVFS over TCP" , "pvfs_tcp" , proto_pvfs , HEURISTIC_ENABLE ) ;
}
|
80
| 0
|
void gic_update ( GICState * s ) {
int best_irq ;
int best_prio ;
int irq ;
int level ;
int cpu ;
int cm ;
for ( cpu = 0 ;
cpu < NUM_CPU ( s ) ;
cpu ++ ) {
cm = 1 << cpu ;
s -> current_pending [ cpu ] = 1023 ;
if ( ! s -> enabled || ! s -> cpu_enabled [ cpu ] ) {
qemu_irq_lower ( s -> parent_irq [ cpu ] ) ;
return ;
}
best_prio = 0x100 ;
best_irq = 1023 ;
for ( irq = 0 ;
irq < s -> num_irq ;
irq ++ ) {
if ( GIC_TEST_ENABLED ( irq , cm ) && GIC_TEST_PENDING ( irq , cm ) ) {
if ( GIC_GET_PRIORITY ( irq , cpu ) < best_prio ) {
best_prio = GIC_GET_PRIORITY ( irq , cpu ) ;
best_irq = irq ;
}
}
}
level = 0 ;
if ( best_prio < s -> priority_mask [ cpu ] ) {
s -> current_pending [ cpu ] = best_irq ;
if ( best_prio < s -> running_priority [ cpu ] ) {
DPRINTF ( "Raised pending IRQ %d (cpu %d)\n" , best_irq , cpu ) ;
level = 1 ;
}
}
qemu_set_irq ( s -> parent_irq [ cpu ] , level ) ;
}
}
|
81
| 0
|
static void dissect_rsvp_fast_reroute ( proto_tree * ti , packet_info * pinfo , proto_tree * rsvp_object_tree , tvbuff_t * tvb , int offset , int obj_length , int rsvp_class _U_ , int type ) {
guint8 flags ;
proto_tree * ti2 , * rsvp_frr_flags_tree ;
proto_item_set_text ( ti , "FAST_REROUTE: " ) ;
switch ( type ) {
case 1 : case 7 : if ( ( ( type == 1 ) && ( obj_length != 24 ) ) || ( ( type == 7 ) && ( obj_length != 20 ) ) ) {
proto_tree_add_expert_format ( rsvp_object_tree , pinfo , & ei_rsvp_invalid_length , tvb , offset , obj_length , "Invalid length: cannot decode" ) ;
proto_item_append_text ( ti , "Invalid length" ) ;
break ;
}
proto_tree_add_uint ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_setup_priority , tvb , offset + 4 , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_hold_priority , tvb , offset + 5 , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_hop_limit , tvb , offset + 6 , 1 , ENC_BIG_ENDIAN ) ;
flags = tvb_get_guint8 ( tvb , offset + 7 ) ;
ti2 = proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_flags , tvb , offset + 7 , 1 , ENC_BIG_ENDIAN ) ;
rsvp_frr_flags_tree = proto_item_add_subtree ( ti2 , TREE ( TT_FAST_REROUTE_FLAGS ) ) ;
proto_tree_add_item ( rsvp_frr_flags_tree , hf_rsvp_frr_flags_one2one_backup , tvb , offset + 7 , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( rsvp_frr_flags_tree , hf_rsvp_frr_flags_facility_backup , tvb , offset + 7 , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_bandwidth , tvb , offset + 8 , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_include_any , tvb , offset + 12 , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_exclude_any , tvb , offset + 16 , 4 , ENC_BIG_ENDIAN ) ;
if ( type == 1 ) {
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_include_all , tvb , offset + 20 , 4 , ENC_BIG_ENDIAN ) ;
}
proto_item_append_text ( ti , "%s%s" , flags & 0x01 ? "One-to-One Backup, " : "" , flags & 0x02 ? "Facility Backup" : "" ) ;
break ;
default : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "Unknown (%u)" , type ) ;
proto_tree_add_item ( rsvp_object_tree , hf_rsvp_fast_reroute_data , tvb , offset + 4 , obj_length - 4 , ENC_NA ) ;
break ;
}
}
|
82
| 1
|
mbfl_string * mbfl_ja_jp_hantozen ( mbfl_string * string , mbfl_string * result , int mode ) {
int n ;
unsigned char * p ;
const mbfl_encoding * encoding ;
mbfl_memory_device device ;
mbfl_convert_filter * decoder = NULL ;
mbfl_convert_filter * encoder = NULL ;
mbfl_convert_filter * tl_filter = NULL ;
mbfl_convert_filter * next_filter = NULL ;
mbfl_filt_tl_jisx0201_jisx0208_param * param = NULL ;
if ( string == NULL || result == NULL ) {
return NULL ;
}
encoding = mbfl_no2encoding ( string -> no_encoding ) ;
if ( encoding == NULL ) {
return NULL ;
}
mbfl_memory_device_init ( & device , string -> len , 0 ) ;
mbfl_string_init ( result ) ;
result -> no_language = string -> no_language ;
result -> no_encoding = string -> no_encoding ;
decoder = mbfl_convert_filter_new ( mbfl_no_encoding_wchar , string -> no_encoding , mbfl_memory_device_output , 0 , & device ) ;
if ( decoder == NULL ) {
goto out ;
}
next_filter = decoder ;
param = ( mbfl_filt_tl_jisx0201_jisx0208_param * ) mbfl_malloc ( sizeof ( mbfl_filt_tl_jisx0201_jisx0208_param ) ) ;
if ( param == NULL ) {
goto out ;
}
param -> mode = mode ;
tl_filter = mbfl_convert_filter_new2 ( & vtbl_tl_jisx0201_jisx0208 , ( int ( * ) ( int , void * ) ) next_filter -> filter_function , ( int ( * ) ( void * ) ) next_filter -> filter_flush , next_filter ) ;
if ( tl_filter == NULL ) {
mbfl_free ( param ) ;
goto out ;
}
tl_filter -> opaque = param ;
next_filter = tl_filter ;
encoder = mbfl_convert_filter_new ( string -> no_encoding , mbfl_no_encoding_wchar , ( int ( * ) ( int , void * ) ) next_filter -> filter_function , ( int ( * ) ( void * ) ) next_filter -> filter_flush , next_filter ) ;
if ( encoder == NULL ) {
goto out ;
}
p = string -> val ;
n = string -> len ;
if ( p != NULL ) {
while ( n > 0 ) {
if ( ( * encoder -> filter_function ) ( * p ++ , encoder ) < 0 ) {
break ;
}
n -- ;
}
}
mbfl_convert_filter_flush ( encoder ) ;
result = mbfl_memory_device_result ( & device , result ) ;
out : if ( tl_filter != NULL ) {
if ( tl_filter -> opaque != NULL ) {
mbfl_free ( tl_filter -> opaque ) ;
}
mbfl_convert_filter_delete ( tl_filter ) ;
}
if ( decoder != NULL ) {
mbfl_convert_filter_delete ( decoder ) ;
}
if ( encoder != NULL ) {
mbfl_convert_filter_delete ( encoder ) ;
}
return result ;
}
|
83
| 0
|
static void dca_downmix ( float * * samples , int srcfmt , int downmix_coef [ DCA_PRIM_CHANNELS_MAX ] [ 2 ] , const int8_t * channel_mapping ) {
int c , l , r , sl , sr , s ;
int i ;
float t , u , v ;
float coef [ DCA_PRIM_CHANNELS_MAX ] [ 2 ] ;
for ( i = 0 ;
i < DCA_PRIM_CHANNELS_MAX ;
i ++ ) {
coef [ i ] [ 0 ] = dca_downmix_coeffs [ downmix_coef [ i ] [ 0 ] ] ;
coef [ i ] [ 1 ] = dca_downmix_coeffs [ downmix_coef [ i ] [ 1 ] ] ;
}
switch ( srcfmt ) {
case DCA_MONO : case DCA_CHANNEL : case DCA_STEREO_TOTAL : case DCA_STEREO_SUMDIFF : case DCA_4F2R : av_log ( NULL , 0 , "Not implemented!\n" ) ;
break ;
case DCA_STEREO : break ;
case DCA_3F : c = channel_mapping [ 0 ] ;
l = channel_mapping [ 1 ] ;
r = channel_mapping [ 2 ] ;
DOWNMIX_TO_STEREO ( MIX_FRONT3 ( samples , coef ) , ) ;
break ;
case DCA_2F1R : s = channel_mapping [ 2 ] ;
DOWNMIX_TO_STEREO ( MIX_REAR1 ( samples , s , 2 , coef ) , ) ;
break ;
case DCA_3F1R : c = channel_mapping [ 0 ] ;
l = channel_mapping [ 1 ] ;
r = channel_mapping [ 2 ] ;
s = channel_mapping [ 3 ] ;
DOWNMIX_TO_STEREO ( MIX_FRONT3 ( samples , coef ) , MIX_REAR1 ( samples , s , 3 , coef ) ) ;
break ;
case DCA_2F2R : sl = channel_mapping [ 2 ] ;
sr = channel_mapping [ 3 ] ;
DOWNMIX_TO_STEREO ( MIX_REAR2 ( samples , sl , sr , 2 , coef ) , ) ;
break ;
case DCA_3F2R : c = channel_mapping [ 0 ] ;
l = channel_mapping [ 1 ] ;
r = channel_mapping [ 2 ] ;
sl = channel_mapping [ 3 ] ;
sr = channel_mapping [ 4 ] ;
DOWNMIX_TO_STEREO ( MIX_FRONT3 ( samples , coef ) , MIX_REAR2 ( samples , sl , sr , 3 , coef ) ) ;
break ;
}
}
|
84
| 0
|
static void gpgsm_io_event ( void * engine , gpgme_event_io_t type , void * type_data ) {
engine_gpgsm_t gpgsm = engine ;
TRACE3 ( DEBUG_ENGINE , "gpgme:gpgsm_io_event" , gpgsm , "event %p, type %d, type_data %p" , gpgsm -> io_cbs . event , type , type_data ) ;
if ( gpgsm -> io_cbs . event ) ( * gpgsm -> io_cbs . event ) ( gpgsm -> io_cbs . event_priv , type , type_data ) ;
}
|
85
| 0
|
static char * fieldflags2str ( uint f ) {
static char buf [ 1024 ] ;
char * s = buf ;
* s = 0 ;
# define ff2s_check_flag ( X ) if ( f & X ## _FLAG ) {
s = strmov ( s , # X " " ) ;
f &= ~ X ## _FLAG ;
}
ff2s_check_flag ( NOT_NULL ) ;
ff2s_check_flag ( PRI_KEY ) ;
ff2s_check_flag ( UNIQUE_KEY ) ;
ff2s_check_flag ( MULTIPLE_KEY ) ;
ff2s_check_flag ( BLOB ) ;
ff2s_check_flag ( UNSIGNED ) ;
ff2s_check_flag ( ZEROFILL ) ;
ff2s_check_flag ( BINARY ) ;
ff2s_check_flag ( ENUM ) ;
ff2s_check_flag ( AUTO_INCREMENT ) ;
ff2s_check_flag ( TIMESTAMP ) ;
ff2s_check_flag ( SET ) ;
ff2s_check_flag ( NO_DEFAULT_VALUE ) ;
ff2s_check_flag ( NUM ) ;
ff2s_check_flag ( PART_KEY ) ;
ff2s_check_flag ( GROUP ) ;
ff2s_check_flag ( UNIQUE ) ;
ff2s_check_flag ( BINCMP ) ;
ff2s_check_flag ( ON_UPDATE_NOW ) ;
# undef ff2s_check_flag if ( f ) sprintf ( s , " unknows=0x%04x" , f ) ;
return buf ;
}
|
86
| 1
|
static int parse_vType ( tvbuff_t * tvb , int offset , guint16 * vtype ) {
guint16 tmp_vtype = tvb_get_letohs ( tvb , offset ) ;
guint16 modifier = tmp_vtype & 0xFF00 ;
switch ( tmp_vtype & 0xFF ) {
case VT_EMPTY : * vtype = VT_EMPTY ;
break ;
case VT_NULL : * vtype = VT_NULL ;
break ;
case VT_I2 : * vtype = VT_I2 ;
break ;
case VT_I4 : * vtype = VT_I4 ;
break ;
case VT_R4 : * vtype = VT_R4 ;
break ;
case VT_R8 : * vtype = VT_R8 ;
break ;
case VT_CY : * vtype = VT_CY ;
break ;
case VT_DATE : * vtype = VT_DATE ;
break ;
case VT_BSTR : * vtype = VT_BSTR ;
break ;
case VT_ERROR : * vtype = VT_ERROR ;
break ;
case VT_BOOL : * vtype = VT_BOOL ;
break ;
case VT_VARIANT : * vtype = VT_VARIANT ;
break ;
case VT_DECIMAL : * vtype = VT_DECIMAL ;
break ;
case VT_I1 : * vtype = VT_I1 ;
break ;
case VT_UI1 : * vtype = VT_UI1 ;
break ;
case VT_UI2 : * vtype = VT_UI2 ;
break ;
case VT_UI4 : * vtype = VT_UI4 ;
break ;
case VT_I8 : * vtype = VT_I8 ;
break ;
case VT_UI8 : * vtype = VT_UI8 ;
break ;
case VT_INT : * vtype = VT_INT ;
break ;
case VT_UINT : * vtype = VT_UINT ;
break ;
case VT_LPSTR : * vtype = VT_LPSTR ;
break ;
case VT_LPWSTR : * vtype = VT_LPWSTR ;
break ;
case VT_COMPRESSED_LPWSTR : * vtype = VT_COMPRESSED_LPWSTR ;
break ;
case VT_FILETIME : * vtype = VT_FILETIME ;
break ;
case VT_BLOB : * vtype = VT_BLOB ;
break ;
case VT_BLOB_OBJECT : * vtype = VT_BLOB_OBJECT ;
break ;
case VT_CLSID : * vtype = VT_CLSID ;
break ;
default : DISSECTOR_ASSERT ( FALSE ) ;
break ;
}
if ( modifier ) {
switch ( modifier ) {
case VT_VECTOR : * vtype |= VT_VECTOR ;
break ;
case VT_ARRAY : * vtype |= VT_ARRAY ;
break ;
default : DISSECTOR_ASSERT ( FALSE ) ;
break ;
}
}
return offset + 2 ;
}
|
87
| 0
|
static int mime_header_encoder_block_collector ( int c , void * data ) {
int n ;
struct mime_header_encoder_data * pe = ( struct mime_header_encoder_data * ) data ;
switch ( pe -> status2 ) {
case 1 : pe -> prevpos = pe -> outdev . pos ;
mbfl_convert_filter_copy ( pe -> conv2_filter , pe -> conv2_filter_backup ) ;
mbfl_convert_filter_copy ( pe -> encod_filter , pe -> encod_filter_backup ) ;
( * pe -> conv2_filter -> filter_function ) ( c , pe -> conv2_filter ) ;
( * pe -> conv2_filter -> filter_flush ) ( pe -> conv2_filter ) ;
( * pe -> encod_filter -> filter_flush ) ( pe -> encod_filter ) ;
n = pe -> outdev . pos - pe -> linehead + pe -> firstindent ;
pe -> outdev . pos = pe -> prevpos ;
mbfl_convert_filter_copy ( pe -> conv2_filter_backup , pe -> conv2_filter ) ;
mbfl_convert_filter_copy ( pe -> encod_filter_backup , pe -> encod_filter ) ;
if ( n >= 74 ) {
( * pe -> conv2_filter -> filter_flush ) ( pe -> conv2_filter ) ;
( * pe -> encod_filter -> filter_flush ) ( pe -> encod_filter ) ;
mbfl_memory_device_strncat ( & pe -> outdev , "\x3f\x3d" , 2 ) ;
mbfl_memory_device_strncat ( & pe -> outdev , pe -> lwsp , pe -> lwsplen ) ;
pe -> linehead = pe -> outdev . pos ;
pe -> firstindent = 0 ;
mbfl_memory_device_strncat ( & pe -> outdev , pe -> encname , pe -> encnamelen ) ;
c = ( * pe -> conv2_filter -> filter_function ) ( c , pe -> conv2_filter ) ;
}
else {
c = ( * pe -> conv2_filter -> filter_function ) ( c , pe -> conv2_filter ) ;
}
break ;
default : mbfl_memory_device_strncat ( & pe -> outdev , pe -> encname , pe -> encnamelen ) ;
c = ( * pe -> conv2_filter -> filter_function ) ( c , pe -> conv2_filter ) ;
pe -> status2 = 1 ;
break ;
}
return c ;
}
|
88
| 0
|
static gpgme_error_t gpgsm_set_fd ( engine_gpgsm_t gpgsm , fd_type_t fd_type , const char * opt ) {
gpg_error_t err = 0 ;
char line [ COMMANDLINELEN ] ;
char * which ;
iocb_data_t * iocb_data ;
# if USE_DESCRIPTOR_PASSING int dir ;
# endif switch ( fd_type ) {
case INPUT_FD : which = "INPUT" ;
iocb_data = & gpgsm -> input_cb ;
break ;
case OUTPUT_FD : which = "OUTPUT" ;
iocb_data = & gpgsm -> output_cb ;
break ;
case MESSAGE_FD : which = "MESSAGE" ;
iocb_data = & gpgsm -> message_cb ;
break ;
default : return gpg_error ( GPG_ERR_INV_VALUE ) ;
}
# if USE_DESCRIPTOR_PASSING dir = iocb_data -> dir ;
iocb_data -> server_fd = _gpgme_data_get_fd ( iocb_data -> data ) ;
if ( iocb_data -> server_fd < 0 ) {
int fds [ 2 ] ;
if ( _gpgme_io_pipe ( fds , dir ) < 0 ) return gpg_error_from_syserror ( ) ;
iocb_data -> fd = dir ? fds [ 0 ] : fds [ 1 ] ;
iocb_data -> server_fd = dir ? fds [ 1 ] : fds [ 0 ] ;
if ( _gpgme_io_set_close_notify ( iocb_data -> fd , close_notify_handler , gpgsm ) ) {
err = gpg_error ( GPG_ERR_GENERAL ) ;
goto leave_set_fd ;
}
}
err = assuan_sendfd ( gpgsm -> assuan_ctx , iocb_data -> server_fd ) ;
if ( err ) goto leave_set_fd ;
_gpgme_io_close ( iocb_data -> server_fd ) ;
iocb_data -> server_fd = - 1 ;
if ( opt ) snprintf ( line , COMMANDLINELEN , "%s FD %s" , which , opt ) ;
else snprintf ( line , COMMANDLINELEN , "%s FD" , which ) ;
# else if ( opt ) snprintf ( line , COMMANDLINELEN , "%s FD=%s %s" , which , iocb_data -> server_fd_str , opt ) ;
else snprintf ( line , COMMANDLINELEN , "%s FD=%s" , which , iocb_data -> server_fd_str ) ;
# endif err = gpgsm_assuan_simple_command ( gpgsm -> assuan_ctx , line , NULL , NULL ) ;
# if USE_DESCRIPTOR_PASSING leave_set_fd : if ( err ) {
_gpgme_io_close ( iocb_data -> fd ) ;
iocb_data -> fd = - 1 ;
if ( iocb_data -> server_fd != - 1 ) {
_gpgme_io_close ( iocb_data -> server_fd ) ;
iocb_data -> server_fd = - 1 ;
}
}
# endif return err ;
}
|
89
| 0
|
static Asn1Generic * Asn1GenericNew ( void ) {
Asn1Generic * obj ;
obj = SCMalloc ( sizeof ( Asn1Generic ) ) ;
if ( obj != NULL ) memset ( obj , 0 , sizeof ( Asn1Generic ) ) ;
return obj ;
}
|
90
| 1
|
static void fadst4 ( const int16_t * input , int16_t * output ) {
int x0 , x1 , x2 , x3 ;
int s0 , s1 , s2 , s3 , s4 , s5 , s6 , s7 ;
x0 = input [ 0 ] ;
x1 = input [ 1 ] ;
x2 = input [ 2 ] ;
x3 = input [ 3 ] ;
if ( ! ( x0 | x1 | x2 | x3 ) ) {
output [ 0 ] = output [ 1 ] = output [ 2 ] = output [ 3 ] = 0 ;
return ;
}
s0 = sinpi_1_9 * x0 ;
s1 = sinpi_4_9 * x0 ;
s2 = sinpi_2_9 * x1 ;
s3 = sinpi_1_9 * x1 ;
s4 = sinpi_3_9 * x2 ;
s5 = sinpi_4_9 * x3 ;
s6 = sinpi_2_9 * x3 ;
s7 = x0 + x1 - x3 ;
x0 = s0 + s2 + s5 ;
x1 = sinpi_3_9 * s7 ;
x2 = s1 - s3 + s6 ;
x3 = s4 ;
s0 = x0 + x3 ;
s1 = x1 ;
s2 = x2 - x3 ;
s3 = x2 - x0 + x3 ;
output [ 0 ] = fdct_round_shift ( s0 ) ;
output [ 1 ] = fdct_round_shift ( s1 ) ;
output [ 2 ] = fdct_round_shift ( s2 ) ;
output [ 3 ] = fdct_round_shift ( s3 ) ;
}
|
91
| 0
|
static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
BinkAudioContext * s = avctx -> priv_data ;
AVFrame * frame = data ;
GetBitContext * gb = & s -> gb ;
int ret , consumed = 0 ;
if ( ! get_bits_left ( gb ) ) {
uint8_t * buf ;
if ( ! avpkt -> size ) {
* got_frame_ptr = 0 ;
return 0 ;
}
if ( avpkt -> size < 4 ) {
av_log ( avctx , AV_LOG_ERROR , "Packet is too small\n" ) ;
return AVERROR_INVALIDDATA ;
}
buf = av_realloc ( s -> packet_buffer , avpkt -> size + FF_INPUT_BUFFER_PADDING_SIZE ) ;
if ( ! buf ) return AVERROR ( ENOMEM ) ;
s -> packet_buffer = buf ;
memcpy ( s -> packet_buffer , avpkt -> data , avpkt -> size ) ;
init_get_bits ( gb , s -> packet_buffer , avpkt -> size * 8 ) ;
consumed = avpkt -> size ;
skip_bits_long ( gb , 32 ) ;
}
frame -> nb_samples = s -> frame_len ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
if ( decode_block ( s , ( float * * ) frame -> extended_data , avctx -> codec -> id == AV_CODEC_ID_BINKAUDIO_DCT ) ) {
av_log ( avctx , AV_LOG_ERROR , "Incomplete packet\n" ) ;
return AVERROR_INVALIDDATA ;
}
get_bits_align32 ( gb ) ;
frame -> nb_samples = s -> block_size / avctx -> channels ;
* got_frame_ptr = 1 ;
return consumed ;
}
|
92
| 0
|
static uint32_t gic_dist_readw ( void * opaque , hwaddr offset ) {
uint32_t val ;
val = gic_dist_readb ( opaque , offset ) ;
val |= gic_dist_readb ( opaque , offset + 1 ) << 8 ;
return val ;
}
|
93
| 0
|
int vp9_hex_search ( const MACROBLOCK * x , MV * ref_mv , int search_param , int sad_per_bit , int do_init_search , int * sad_list , const vp9_variance_fn_ptr_t * vfp , int use_mvcost , const MV * center_mv , MV * best_mv ) {
static const int hex_num_candidates [ MAX_PATTERN_SCALES ] = {
8 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 }
;
static const MV hex_candidates [ MAX_PATTERN_SCALES ] [ MAX_PATTERN_CANDIDATES ] = {
{
{
- 1 , - 1 }
, {
0 , - 1 }
, {
1 , - 1 }
, {
1 , 0 }
, {
1 , 1 }
, {
0 , 1 }
, {
- 1 , 1 }
, {
- 1 , 0 }
}
, {
{
- 1 , - 2 }
, {
1 , - 2 }
, {
2 , 0 }
, {
1 , 2 }
, {
- 1 , 2 }
, {
- 2 , 0 }
}
, {
{
- 2 , - 4 }
, {
2 , - 4 }
, {
4 , 0 }
, {
2 , 4 }
, {
- 2 , 4 }
, {
- 4 , 0 }
}
, {
{
- 4 , - 8 }
, {
4 , - 8 }
, {
8 , 0 }
, {
4 , 8 }
, {
- 4 , 8 }
, {
- 8 , 0 }
}
, {
{
- 8 , - 16 }
, {
8 , - 16 }
, {
16 , 0 }
, {
8 , 16 }
, {
- 8 , 16 }
, {
- 16 , 0 }
}
, {
{
- 16 , - 32 }
, {
16 , - 32 }
, {
32 , 0 }
, {
16 , 32 }
, {
- 16 , 32 }
, {
- 32 , 0 }
}
, {
{
- 32 , - 64 }
, {
32 , - 64 }
, {
64 , 0 }
, {
32 , 64 }
, {
- 32 , 64 }
, {
- 64 , 0 }
}
, {
{
- 64 , - 128 }
, {
64 , - 128 }
, {
128 , 0 }
, {
64 , 128 }
, {
- 64 , 128 }
, {
- 128 , 0 }
}
, {
{
- 128 , - 256 }
, {
128 , - 256 }
, {
256 , 0 }
, {
128 , 256 }
, {
- 128 , 256 }
, {
- 256 , 0 }
}
, {
{
- 256 , - 512 }
, {
256 , - 512 }
, {
512 , 0 }
, {
256 , 512 }
, {
- 256 , 512 }
, {
- 512 , 0 }
}
, {
{
- 512 , - 1024 }
, {
512 , - 1024 }
, {
1024 , 0 }
, {
512 , 1024 }
, {
- 512 , 1024 }
, {
- 1024 , 0 }
}
, }
;
return vp9_pattern_search ( x , ref_mv , search_param , sad_per_bit , do_init_search , sad_list , vfp , use_mvcost , center_mv , best_mv , hex_num_candidates , hex_candidates ) ;
}
|
94
| 0
|
static void pk_transaction_repo_remove ( PkTransaction * transaction , GVariant * params , GDBusMethodInvocation * context ) {
PkBitfield transaction_flags ;
const gchar * repo_id ;
gboolean autoremove ;
gboolean ret ;
g_autoptr ( GError ) error = NULL ;
g_autofree gchar * tmp = NULL ;
g_return_if_fail ( PK_IS_TRANSACTION ( transaction ) ) ;
g_return_if_fail ( transaction -> priv -> tid != NULL ) ;
g_variant_get ( params , "(t&sb)" , & transaction_flags , & repo_id , & autoremove ) ;
tmp = pk_transaction_flag_bitfield_to_string ( transaction_flags ) ;
g_debug ( "RepoRemove method called: %s, %s, %i" , tmp , repo_id , autoremove ) ;
if ( ! pk_backend_is_implemented ( transaction -> priv -> backend , PK_ROLE_ENUM_REPO_REMOVE ) ) {
g_set_error_literal ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_NOT_SUPPORTED , "RepoSetData not supported by backend" ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
ret = pk_transaction_strvalidate ( repo_id , & error ) ;
if ( ! ret ) {
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
transaction -> priv -> cached_repo_id = g_strdup ( repo_id ) ;
transaction -> priv -> cached_transaction_flags = transaction_flags ;
transaction -> priv -> cached_autoremove = autoremove ;
pk_transaction_set_role ( transaction , PK_ROLE_ENUM_REPO_REMOVE ) ;
ret = pk_transaction_obtain_authorization ( transaction , PK_ROLE_ENUM_REPO_REMOVE , & error ) ;
if ( ! ret ) {
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
out : pk_transaction_dbus_return ( context , error ) ;
}
|
95
| 1
|
static int parse_CRestriction ( tvbuff_t * tvb , int offset , proto_tree * parent_tree , proto_tree * pad_tree , struct CRestriction * v , const char * fmt , ... ) {
proto_tree * tree ;
proto_item * item ;
const char * str , * 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_CRestriction , & item , txt ) ;
offset = parse_rType ( tvb , offset , tree , & v -> ulType , & str ) ;
proto_item_append_text ( item , " Type: %s" , str ) ;
v -> Weight = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_uint ( tree , hf_mswsp_crestrict_weight , tvb , offset , 4 , v -> Weight ) ;
offset += 4 ;
switch ( v -> ulType ) {
case RTNone : break ;
case RTAnd : case RTOr : case RTProximity : case RTPhrase : {
v -> u . RTAnd = EP_ALLOC ( struct CNodeRestriction ) ;
offset = parse_CNodeRestriction ( tvb , offset , tree , pad_tree , v -> u . RTAnd , "CNodeRestriction" ) ;
break ;
}
case RTNot : {
v -> u . RTNot = EP_ALLOC ( struct CRestriction ) ;
offset = parse_CRestriction ( tvb , offset , tree , pad_tree , v -> u . RTNot , "CRestriction" ) ;
break ;
}
case RTProperty : {
v -> u . RTProperty = EP_ALLOC ( struct CPropertyRestriction ) ;
offset = parse_CPropertyRestriction ( tvb , offset , tree , pad_tree , v -> u . RTProperty , "CPropertyRestriction" ) ;
break ;
}
case RTCoerce_Add : case RTCoerce_Multiply : case RTCoerce_Absolute : {
v -> u . RTCoerce_Add = EP_ALLOC ( struct CCoercionRestriction ) ;
offset = parse_CCoercionRestriction ( tvb , offset , tree , pad_tree , v -> u . RTCoerce_Add , "CCoercionRestriction" ) ;
break ;
}
case RTContent : {
v -> u . RTContent = EP_ALLOC ( struct CContentRestriction ) ;
offset = parse_CContentRestriction ( tvb , offset , tree , pad_tree , v -> u . RTContent , "CContentRestriction" ) ;
break ;
}
case RTReuseWhere : {
v -> u . RTReuseWhere = EP_ALLOC ( struct CReuseWhere ) ;
offset = parse_CReuseWhere ( tvb , offset , tree , pad_tree , v -> u . RTReuseWhere , "CReuseWhere" ) ;
break ;
}
case RTNatLanguage : {
v -> u . RTNatLanguage = EP_ALLOC ( struct CNatLanguageRestriction ) ;
offset = parse_CNatLanguageRestriction ( tvb , offset , tree , pad_tree , v -> u . RTNatLanguage , "CNatLanguageRestriction" ) ;
break ;
}
default : proto_item_append_text ( item , " Not supported!" ) ;
}
proto_item_set_end ( item , tvb , offset ) ;
return offset ;
}
|
96
| 1
|
static void UConverter_toUnicode_ISCII_OFFSETS_LOGIC ( UConverterToUnicodeArgs * args , UErrorCode * err ) {
const char * source = ( char * ) args -> source ;
UChar * target = args -> target ;
const char * sourceLimit = args -> sourceLimit ;
const UChar * targetLimit = args -> targetLimit ;
uint32_t targetUniChar = 0x0000 ;
uint8_t sourceChar = 0x0000 ;
UConverterDataISCII * data ;
UChar32 * toUnicodeStatus = NULL ;
UChar32 tempTargetUniChar = 0x0000 ;
UChar * contextCharToUnicode = NULL ;
UBool found ;
int i ;
int offset = 0 ;
if ( ( args -> converter == NULL ) || ( target < args -> target ) || ( source < args -> source ) ) {
* err = U_ILLEGAL_ARGUMENT_ERROR ;
return ;
}
data = ( UConverterDataISCII * ) ( args -> converter -> extraInfo ) ;
contextCharToUnicode = & data -> contextCharToUnicode ;
toUnicodeStatus = ( UChar32 * ) & args -> converter -> toUnicodeStatus ;
while ( U_SUCCESS ( * err ) && source < sourceLimit ) {
targetUniChar = missingCharMarker ;
if ( target < targetLimit ) {
sourceChar = ( unsigned char ) * ( source ) ++ ;
if ( * contextCharToUnicode == ATR ) {
if ( ( uint8_t ) ( PNJ - sourceChar ) <= PNJ - DEV ) {
data -> currentDeltaToUnicode = ( uint16_t ) ( lookupTable [ sourceChar & 0x0F ] [ 0 ] * DELTA ) ;
data -> currentMaskToUnicode = ( MaskEnum ) lookupTable [ sourceChar & 0x0F ] [ 1 ] ;
}
else if ( sourceChar == DEF ) {
data -> currentDeltaToUnicode = data -> defDeltaToUnicode ;
data -> currentMaskToUnicode = data -> defMaskToUnicode ;
}
else {
if ( ( sourceChar >= 0x21 && sourceChar <= 0x3F ) ) {
}
else {
* err = U_ILLEGAL_CHAR_FOUND ;
* contextCharToUnicode = NO_CHAR_MARKER ;
goto CALLBACK ;
}
}
* contextCharToUnicode = NO_CHAR_MARKER ;
continue ;
}
else if ( * contextCharToUnicode == EXT ) {
if ( ( uint8_t ) ( EXT_RANGE_END - sourceChar ) <= ( EXT_RANGE_END - EXT_RANGE_BEGIN ) ) {
if ( sourceChar == 0xBF || sourceChar == 0xB8 ) {
targetUniChar = ( sourceChar == 0xBF ) ? DEV_ABBR_SIGN : DEV_ANUDATTA ;
if ( validityTable [ ( uint8_t ) targetUniChar ] & data -> currentMaskToUnicode ) {
* contextCharToUnicode = NO_CHAR_MARKER ;
if ( data -> prevToUnicodeStatus ) {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 1 ) , data -> prevToUnicodeStatus , 0 , err ) ;
data -> prevToUnicodeStatus = 0x0000 ;
}
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 2 ) , targetUniChar , data -> currentDeltaToUnicode , err ) ;
continue ;
}
}
targetUniChar = missingCharMarker ;
* err = U_INVALID_CHAR_FOUND ;
}
else {
* contextCharToUnicode = NO_CHAR_MARKER ;
* err = U_ILLEGAL_CHAR_FOUND ;
}
goto CALLBACK ;
}
else if ( * contextCharToUnicode == ISCII_INV ) {
if ( sourceChar == ISCII_HALANT ) {
targetUniChar = 0x0020 ;
}
else {
targetUniChar = ZWJ ;
}
if ( data -> prevToUnicodeStatus ) {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 1 ) , data -> prevToUnicodeStatus , 0 , err ) ;
data -> prevToUnicodeStatus = 0x0000 ;
}
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 2 ) , targetUniChar , data -> currentDeltaToUnicode , err ) ;
* contextCharToUnicode = NO_CHAR_MARKER ;
}
switch ( sourceChar ) {
case ISCII_INV : case EXT : case ATR : * contextCharToUnicode = ( UChar ) sourceChar ;
if ( * toUnicodeStatus != missingCharMarker ) {
if ( data -> prevToUnicodeStatus ) {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 1 ) , data -> prevToUnicodeStatus , 0 , err ) ;
data -> prevToUnicodeStatus = 0x0000 ;
}
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 2 ) , * toUnicodeStatus , data -> currentDeltaToUnicode , err ) ;
* toUnicodeStatus = missingCharMarker ;
}
continue ;
case ISCII_DANDA : if ( * contextCharToUnicode == ISCII_DANDA ) {
targetUniChar = DOUBLE_DANDA ;
* contextCharToUnicode = NO_CHAR_MARKER ;
* toUnicodeStatus = missingCharMarker ;
}
else {
GET_MAPPING ( sourceChar , targetUniChar , data ) ;
* contextCharToUnicode = sourceChar ;
}
break ;
case ISCII_HALANT : if ( * contextCharToUnicode == ISCII_HALANT ) {
targetUniChar = ZWNJ ;
* contextCharToUnicode = NO_CHAR_MARKER ;
}
else {
GET_MAPPING ( sourceChar , targetUniChar , data ) ;
* contextCharToUnicode = sourceChar ;
}
break ;
case 0x0A : case 0x0D : data -> resetToDefaultToUnicode = TRUE ;
GET_MAPPING ( sourceChar , targetUniChar , data ) ;
* contextCharToUnicode = sourceChar ;
break ;
case ISCII_VOWEL_SIGN_E : i = 1 ;
found = FALSE ;
for ( ;
i < vowelSignESpecialCases [ 0 ] [ 0 ] ;
i ++ ) {
U_ASSERT ( i < UPRV_LENGTHOF ( vowelSignESpecialCases ) ) ;
if ( vowelSignESpecialCases [ i ] [ 0 ] == ( uint8_t ) * contextCharToUnicode ) {
targetUniChar = vowelSignESpecialCases [ i ] [ 1 ] ;
found = TRUE ;
break ;
}
}
if ( found ) {
if ( validityTable [ ( uint8_t ) targetUniChar ] & data -> currentMaskToUnicode ) {
* contextCharToUnicode = NO_CHAR_MARKER ;
* toUnicodeStatus = missingCharMarker ;
break ;
}
}
GET_MAPPING ( sourceChar , targetUniChar , data ) ;
* contextCharToUnicode = sourceChar ;
break ;
case ISCII_NUKTA : if ( * contextCharToUnicode == ISCII_HALANT ) {
targetUniChar = ZWJ ;
* contextCharToUnicode = NO_CHAR_MARKER ;
break ;
}
else if ( data -> currentDeltaToUnicode == PNJ_DELTA && data -> contextCharToUnicode == 0xc0 ) {
if ( data -> prevToUnicodeStatus ) {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 1 ) , data -> prevToUnicodeStatus , 0 , err ) ;
data -> prevToUnicodeStatus = 0x0000 ;
}
targetUniChar = PNJ_RRA ;
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source ) - 2 , targetUniChar , 0 , err ) ;
if ( U_SUCCESS ( * err ) ) {
targetUniChar = PNJ_SIGN_VIRAMA ;
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source ) - 2 , targetUniChar , 0 , err ) ;
if ( U_SUCCESS ( * err ) ) {
targetUniChar = PNJ_HA ;
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source ) - 2 , targetUniChar , 0 , err ) ;
}
else {
args -> converter -> UCharErrorBuffer [ args -> converter -> UCharErrorBufferLength ++ ] = PNJ_HA ;
}
}
else {
args -> converter -> UCharErrorBuffer [ args -> converter -> UCharErrorBufferLength ++ ] = PNJ_SIGN_VIRAMA ;
args -> converter -> UCharErrorBuffer [ args -> converter -> UCharErrorBufferLength ++ ] = PNJ_HA ;
}
* toUnicodeStatus = missingCharMarker ;
data -> contextCharToUnicode = NO_CHAR_MARKER ;
continue ;
}
else {
i = 1 ;
found = FALSE ;
for ( ;
i < nuktaSpecialCases [ 0 ] [ 0 ] ;
i ++ ) {
if ( nuktaSpecialCases [ i ] [ 0 ] == ( uint8_t ) * contextCharToUnicode ) {
targetUniChar = nuktaSpecialCases [ i ] [ 1 ] ;
found = TRUE ;
break ;
}
}
if ( found ) {
if ( validityTable [ ( uint8_t ) targetUniChar ] & data -> currentMaskToUnicode ) {
* contextCharToUnicode = NO_CHAR_MARKER ;
* toUnicodeStatus = missingCharMarker ;
if ( data -> currentDeltaToUnicode == PNJ_DELTA ) {
if ( data -> prevToUnicodeStatus ) {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 1 ) , data -> prevToUnicodeStatus , 0 , err ) ;
data -> prevToUnicodeStatus = 0x0000 ;
}
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 2 ) , targetUniChar , data -> currentDeltaToUnicode , err ) ;
continue ;
}
break ;
}
}
U_FALLTHROUGH ;
}
default : GET_MAPPING ( sourceChar , targetUniChar , data ) ;
* contextCharToUnicode = sourceChar ;
break ;
}
if ( * toUnicodeStatus != missingCharMarker ) {
if ( data -> currentDeltaToUnicode == PNJ_DELTA && data -> prevToUnicodeStatus != 0 && isPNJConsonant ( data -> prevToUnicodeStatus ) && ( * toUnicodeStatus + PNJ_DELTA ) == PNJ_SIGN_VIRAMA && ( targetUniChar + PNJ_DELTA ) == data -> prevToUnicodeStatus ) {
offset = ( int ) ( source - args -> source - 3 ) ;
tempTargetUniChar = PNJ_ADHAK ;
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , offset , tempTargetUniChar , 0 , err ) ;
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , offset , data -> prevToUnicodeStatus , 0 , err ) ;
data -> prevToUnicodeStatus = 0x0000 ;
* toUnicodeStatus = missingCharMarker ;
continue ;
}
else {
if ( data -> prevToUnicodeStatus ) {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 1 ) , data -> prevToUnicodeStatus , 0 , err ) ;
data -> prevToUnicodeStatus = 0x0000 ;
}
if ( data -> currentDeltaToUnicode == PNJ_DELTA && ( targetUniChar + PNJ_DELTA ) == PNJ_BINDI && isPNJBindiTippi ( ( * toUnicodeStatus + PNJ_DELTA ) ) ) {
targetUniChar = PNJ_TIPPI - PNJ_DELTA ;
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 2 ) , * toUnicodeStatus , PNJ_DELTA , err ) ;
}
else if ( data -> currentDeltaToUnicode == PNJ_DELTA && ( targetUniChar + PNJ_DELTA ) == PNJ_SIGN_VIRAMA && isPNJConsonant ( ( * toUnicodeStatus + PNJ_DELTA ) ) ) {
data -> prevToUnicodeStatus = * toUnicodeStatus + PNJ_DELTA ;
}
else {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 2 ) , * toUnicodeStatus , data -> currentDeltaToUnicode , err ) ;
}
}
* toUnicodeStatus = missingCharMarker ;
}
if ( targetUniChar != missingCharMarker ) {
* toUnicodeStatus = ( UChar ) targetUniChar ;
if ( data -> resetToDefaultToUnicode == TRUE ) {
data -> currentDeltaToUnicode = data -> defDeltaToUnicode ;
data -> currentMaskToUnicode = data -> defMaskToUnicode ;
data -> resetToDefaultToUnicode = FALSE ;
}
}
else {
* err = U_INVALID_CHAR_FOUND ;
CALLBACK : args -> converter -> toUBytes [ 0 ] = ( uint8_t ) sourceChar ;
args -> converter -> toULength = 1 ;
break ;
}
}
else {
* err = U_BUFFER_OVERFLOW_ERROR ;
break ;
}
}
if ( U_SUCCESS ( * err ) && args -> flush && source == sourceLimit ) {
UConverter * cnv = args -> converter ;
if ( * contextCharToUnicode == ATR || * contextCharToUnicode == EXT || * contextCharToUnicode == ISCII_INV ) {
cnv -> toUBytes [ 0 ] = ( uint8_t ) * contextCharToUnicode ;
cnv -> toULength = 1 ;
* contextCharToUnicode = NO_CHAR_MARKER ;
}
else {
cnv -> toULength = 0 ;
}
if ( * toUnicodeStatus != missingCharMarker ) {
WRITE_TO_TARGET_TO_U ( args , source , target , args -> offsets , ( source - args -> source - 1 ) , * toUnicodeStatus , data -> currentDeltaToUnicode , err ) ;
* toUnicodeStatus = missingCharMarker ;
}
}
args -> target = target ;
args -> source = source ;
}
|
97
| 0
|
static guint composite_offset ( const tvbuff_t * tvb _U_ , const guint counter ) {
return counter ;
}
|
98
| 1
|
static void dissect_q931_IEs ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * root_tree , proto_tree * q931_tree , gboolean is_over_ip , int offset , int initial_codeset ) {
proto_item * ti ;
proto_tree * ie_tree = NULL ;
guint8 info_element ;
guint8 dummy ;
guint16 info_element_len ;
int codeset , locked_codeset ;
gboolean non_locking_shift , first_segment ;
tvbuff_t * h225_tvb , * next_tvb ;
e164_info_t e164_info ;
e164_info . e164_number_type = NONE ;
e164_info . nature_of_address = NONE ;
e164_info . E164_number_str = "" ;
e164_info . E164_number_length = NONE ;
codeset = locked_codeset = initial_codeset ;
first_segment = FALSE ;
while ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) {
info_element = tvb_get_guint8 ( tvb , offset ) ;
if ( ( info_element & Q931_IE_SO_MASK ) && ( ( info_element & Q931_IE_SO_IDENTIFIER_MASK ) == Q931_IE_SHIFT ) ) {
non_locking_shift = info_element & Q931_IE_SHIFT_NON_LOCKING ;
codeset = info_element & Q931_IE_SHIFT_CODESET ;
if ( ! non_locking_shift ) locked_codeset = codeset ;
if ( q931_tree != NULL ) {
proto_tree_add_uint_format ( q931_tree , hf_q931_locking_codeset , tvb , offset , 1 , codeset , "%s shift to codeset %u: %s" , ( non_locking_shift ? "Non-locking" : "Locking" ) , codeset , val_to_str ( codeset , q931_codeset_vals , "Unknown (0x%02X)" ) ) ;
}
offset += 1 ;
continue ;
}
if ( info_element & Q931_IE_SO_MASK ) {
if ( dissector_get_uint_handle ( codeset_dissector_table , codeset ) || dissector_get_uint_handle ( ie_dissector_table , ( codeset << 8 ) | ( info_element & Q931_IE_SO_IDENTIFIER_MASK ) ) ) {
next_tvb = tvb_new_subset_length ( tvb , offset , 1 ) ;
if ( dissector_try_uint ( ie_dissector_table , ( codeset << 8 ) | ( info_element & Q931_IE_SO_IDENTIFIER_MASK ) , next_tvb , pinfo , q931_tree ) || dissector_try_uint ( codeset_dissector_table , codeset , next_tvb , pinfo , q931_tree ) ) {
offset += 1 ;
codeset = locked_codeset ;
continue ;
}
}
switch ( ( codeset << 8 ) | ( info_element & Q931_IE_SO_IDENTIFIER_MASK ) ) {
case CS0 | Q931_IE_MORE_DATA_OR_SEND_COMP : switch ( info_element ) {
case Q931_IE_MORE_DATA : proto_tree_add_item ( q931_tree , hf_q931_more_data , tvb , offset , 1 , ENC_NA ) ;
break ;
case Q931_IE_SENDING_COMPLETE : proto_tree_add_item ( q931_tree , hf_q931_sending_complete , tvb , offset , 1 , ENC_NA ) ;
break ;
default : proto_tree_add_expert_format ( q931_tree , pinfo , & ei_q931_information_element , tvb , offset , 1 , "Unknown information element (0x%02X)" , info_element ) ;
break ;
}
break ;
case CS0 | Q931_IE_CONGESTION_LEVEL : proto_tree_add_item ( q931_tree , hf_q931_congestion_level , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
case CS0 | Q931_IE_REPEAT_INDICATOR : proto_tree_add_item ( q931_tree , hf_q931_repeat_indicator , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
default : proto_tree_add_expert_format ( q931_tree , pinfo , & ei_q931_information_element , tvb , offset , 1 , "Unknown information element (0x%02X)" , info_element ) ;
break ;
}
offset += 1 ;
codeset = locked_codeset ;
continue ;
}
if ( is_over_ip && tvb_bytes_exist ( tvb , offset , 4 ) && codeset == 0 && tvb_get_guint8 ( tvb , offset ) == Q931_IE_USER_USER && tvb_get_guint8 ( tvb , offset + 3 ) == Q931_PROTOCOL_DISCRIMINATOR_ASN1 ) {
info_element_len = tvb_get_ntohs ( tvb , offset + 1 ) ;
if ( q931_tree != NULL ) {
ie_tree = proto_tree_add_subtree ( q931_tree , tvb , offset , 1 + 2 + info_element_len , ett_q931_ie [ info_element ] , NULL , val_to_str ( info_element , q931_info_element_vals [ codeset ] , "Unknown information element (0x%02X)" ) ) ;
proto_tree_add_uint_format_value ( ie_tree , hf_q931_information_element , tvb , offset , 1 , info_element , "%s" , val_to_str ( info_element , q931_info_element_vals [ codeset ] , "Unknown (0x%02X)" ) ) ;
proto_tree_add_item ( ie_tree , hf_q931_information_element_len , tvb , offset + 1 , 2 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_q931_user_protocol_discriminator , tvb , offset + 3 , 1 , ENC_NA ) ;
}
if ( info_element_len > 1 ) {
if ( ! pinfo -> can_desegment ) {
info_element_len = MIN ( info_element_len , tvb_captured_length_remaining ( tvb , offset + 3 ) ) ;
}
if ( h225_handle != NULL ) {
h225_tvb = tvb_new_subset_length ( tvb , offset + 4 , info_element_len - 1 ) ;
call_dissector ( h225_handle , h225_tvb , pinfo , root_tree ) ;
}
else {
proto_tree_add_item ( ie_tree , hf_q931_user_information_bytes , tvb , offset + 4 , info_element_len - 1 , ENC_NA ) ;
}
}
offset += 1 + 2 + info_element_len ;
}
else {
info_element_len = tvb_get_guint8 ( tvb , offset + 1 ) ;
if ( first_segment && ( tvb_reported_length_remaining ( tvb , offset + 2 ) < info_element_len ) ) {
proto_tree_add_expert ( q931_tree , pinfo , & ei_q931_incomplete_ie , tvb , offset , - 1 ) ;
break ;
}
if ( dissector_get_uint_handle ( codeset_dissector_table , codeset ) || dissector_get_uint_handle ( ie_dissector_table , ( codeset << 8 ) | info_element ) ) {
next_tvb = tvb_new_subset_length ( tvb , offset , info_element_len + 2 ) ;
if ( dissector_try_uint ( ie_dissector_table , ( codeset << 8 ) | info_element , next_tvb , pinfo , q931_tree ) || dissector_try_uint ( codeset_dissector_table , codeset , next_tvb , pinfo , q931_tree ) ) {
offset += 2 + info_element_len ;
codeset = locked_codeset ;
continue ;
}
}
ie_tree = proto_tree_add_subtree ( q931_tree , tvb , offset , 1 + 1 + info_element_len , ett_q931_ie [ info_element ] , & ti , val_to_str ( info_element , q931_info_element_vals [ codeset ] , "Unknown information element (0x%02X)" ) ) ;
proto_tree_add_uint_format_value ( ie_tree , hf_q931_information_element , tvb , offset , 1 , info_element , "%s" , val_to_str ( info_element , q931_info_element_vals [ codeset ] , "Unknown (0x%02X)" ) ) ;
proto_tree_add_uint ( ie_tree , hf_q931_information_element_len , tvb , offset + 1 , 1 , info_element_len ) ;
if ( ( ( codeset << 8 ) | info_element ) == ( CS0 | Q931_IE_SEGMENTED_MESSAGE ) ) {
dissect_q931_segmented_message_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree , ti ) ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , " of %s" , val_to_str_ext ( tvb_get_guint8 ( tvb , offset + 3 ) , & q931_message_type_vals_ext , "Unknown message type (0x%02X)" ) ) ;
if ( tvb_get_guint8 ( tvb , offset + 2 ) & 0x80 ) {
first_segment = TRUE ;
}
else {
proto_tree_add_item ( q931_tree , hf_q931_message_segment , tvb , offset + 4 , - 1 , ENC_NA ) ;
info_element_len += tvb_reported_length_remaining ( tvb , offset + 4 ) ;
}
}
else {
switch ( ( codeset << 8 ) | info_element ) {
case CS0 | Q931_IE_BEARER_CAPABILITY : case CS0 | Q931_IE_LOW_LAYER_COMPAT : if ( q931_tree != NULL ) {
dissect_q931_bearer_capability_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_CAUSE : dissect_q931_cause_ie_unsafe ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_cause_value , & dummy , q931_info_element_vals0 ) ;
break ;
case CS0 | Q931_IE_CHANGE_STATUS : if ( q931_tree != NULL ) {
dissect_q931_change_status_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_CALL_STATE : if ( q931_tree != NULL ) {
dissect_q931_call_state_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_CHANNEL_IDENTIFICATION : if ( q931_tree != NULL ) {
dissect_q931_channel_identification_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_PROGRESS_INDICATOR : if ( q931_tree != NULL ) {
dissect_q931_progress_indicator_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_NETWORK_SPECIFIC_FACIL : case CS0 | Q931_IE_TRANSIT_NETWORK_SEL : if ( q931_tree != NULL ) {
dissect_q931_ns_facilities_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_NOTIFICATION_INDICATOR : if ( q931_tree != NULL ) {
dissect_q931_notification_indicator_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_DISPLAY : if ( q931_tree != NULL ) {
dissect_q931_ia5_ie ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_display_information ) ;
}
break ;
case CS0 | Q931_IE_DATE_TIME : dissect_q931_date_time_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree ) ;
break ;
case CS0 | Q931_IE_KEYPAD_FACILITY : if ( q931_tree != NULL ) {
dissect_q931_ia5_ie ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_keypad_facility ) ;
}
break ;
case CS0 | Q931_IE_SIGNAL : dissect_q931_signal_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree , ti ) ;
break ;
case CS0 | Q931_IE_INFORMATION_RATE : dissect_q931_information_rate_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree , ti ) ;
break ;
case CS0 | Q931_IE_E2E_TRANSIT_DELAY : dissect_q931_e2e_transit_delay_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree , ti ) ;
break ;
case CS0 | Q931_IE_TD_SELECTION_AND_INT : dissect_q931_td_selection_and_int_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree , ti ) ;
break ;
case CS0 | Q931_IE_PL_BINARY_PARAMETERS : if ( q931_tree != NULL ) {
dissect_q931_pl_binary_parameters_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_PL_WINDOW_SIZE : if ( q931_tree != NULL ) {
dissect_q931_pl_window_size_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_PACKET_SIZE : if ( q931_tree != NULL ) {
dissect_q931_packet_size_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_CUG : if ( q931_tree != NULL ) {
dissect_q931_cug_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_REVERSE_CHARGE_IND : if ( q931_tree != NULL ) {
dissect_q931_reverse_charge_ind_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_CONNECTED_NUMBER_DEFAULT : if ( q931_tree != NULL ) {
dissect_q931_number_ie ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_connected_number , e164_info ) ;
}
break ;
case CS0 | Q931_IE_CALLING_PARTY_NUMBER : e164_info . e164_number_type = CALLING_PARTY_NUMBER ;
dissect_q931_number_ie ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_calling_party_number , e164_info ) ;
break ;
case CS0 | Q931_IE_CALLED_PARTY_NUMBER : e164_info . e164_number_type = CALLED_PARTY_NUMBER ;
dissect_q931_number_ie ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_called_party_number , e164_info ) ;
break ;
case CS0 | Q931_IE_CALLING_PARTY_SUBADDR : case CS0 | Q931_IE_CALLED_PARTY_SUBADDR : if ( q931_tree != NULL ) {
dissect_q931_party_subaddr_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_REDIRECTING_NUMBER : if ( q931_tree != NULL ) {
dissect_q931_number_ie ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_redirecting_number , e164_info ) ;
}
break ;
case CS0 | Q931_IE_RESTART_INDICATOR : dissect_q931_restart_indicator_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree , ti ) ;
break ;
case CS0 | Q931_IE_HIGH_LAYER_COMPAT : if ( q931_tree != NULL ) {
dissect_q931_high_layer_compat_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS0 | Q931_IE_USER_USER : if ( q931_tree != NULL ) {
dissect_q931_user_user_ie ( tvb , pinfo , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS5 | Q931_IE_PARTY_CATEGORY : if ( q931_tree != NULL ) {
dissect_q931_party_category_ie ( tvb , offset + 2 , info_element_len , ie_tree ) ;
}
break ;
case CS6 | Q931_IE_DISPLAY : if ( q931_tree != NULL ) {
dissect_q931_ia5_ie ( tvb , offset + 2 , info_element_len , ie_tree , hf_q931_avaya_display ) ;
}
break ;
default : if ( q931_tree != NULL ) {
proto_tree_add_item ( ie_tree , hf_q931_data , tvb , offset + 2 , info_element_len , ENC_NA ) ;
}
break ;
}
}
offset += 1 + 1 + info_element_len ;
}
codeset = locked_codeset ;
}
if ( have_valid_q931_pi ) {
tap_queue_packet ( q931_tap , pinfo , q931_pi ) ;
}
have_valid_q931_pi = FALSE ;
}
|
99
| 0
|
static void bamboo_machine_init ( void ) {
qemu_register_machine ( & bamboo_machine ) ;
}
|
@article{DBLP:journals/corr/abs-2009-07235,
author = {Saikat Chakraborty and
Rahul Krishna and
Yangruibo Ding and
Baishakhi Ray},
title = {Deep Learning based Vulnerability Detection: Are We There Yet?},
journal = {CoRR},
volume = {abs/2009.07235},
year = {2020},
url = {https://arxiv.org/abs/2009.07235},
eprinttype = {arXiv},
eprint = {2009.07235},
timestamp = {Fri, 18 Sep 2020 15:17:35 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2009-07235.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}