instruction
stringclasses 1
value | input
stringlengths 31
235k
| output
class label 2
classes |
---|---|---|
Categorize the following code snippet as vulnerable or not. True or False
|
static int cpu_pre_save ( void * opaque ) {
X86CPU * cpu = opaque ;
CPUX86State * env = & cpu -> env ;
int i ;
env -> fpus_vmstate = ( env -> fpus & ~ 0x3800 ) | ( env -> fpstt & 0x7 ) << 11 ;
env -> fptag_vmstate = 0 ;
for ( i = 0 ;
i < 8 ;
i ++ ) {
env -> fptag_vmstate |= ( ( ! env -> fptags [ i ] ) << i ) ;
}
env -> fpregs_format_vmstate = 0 ;
if ( ! ( env -> cr [ 0 ] & CR0_PE_MASK ) && ( env -> segs [ R_CS ] . flags >> DESC_DPL_SHIFT & 3 ) != 0 ) {
env -> segs [ R_CS ] . flags &= ~ ( env -> segs [ R_CS ] . flags & DESC_DPL_MASK ) ;
env -> segs [ R_DS ] . flags &= ~ ( env -> segs [ R_DS ] . flags & DESC_DPL_MASK ) ;
env -> segs [ R_ES ] . flags &= ~ ( env -> segs [ R_ES ] . flags & DESC_DPL_MASK ) ;
env -> segs [ R_FS ] . flags &= ~ ( env -> segs [ R_FS ] . flags & DESC_DPL_MASK ) ;
env -> segs [ R_GS ] . flags &= ~ ( env -> segs [ R_GS ] . flags & DESC_DPL_MASK ) ;
env -> segs [ R_SS ] . flags &= ~ ( env -> segs [ R_SS ] . flags & DESC_DPL_MASK ) ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static hb_unicode_general_category_t hb_ucdn_general_category ( hb_unicode_funcs_t * ufuncs , hb_codepoint_t unicode , void * user_data HB_UNUSED ) {
return ( hb_unicode_general_category_t ) ucdn_get_general_category ( unicode ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void inverse_quant ( int16_t * cur_lsp , int16_t * prev_lsp , uint8_t * lsp_index , int bad_frame ) {
int min_dist , pred ;
int i , j , temp , stable ;
if ( ! bad_frame ) {
min_dist = 0x100 ;
pred = 12288 ;
}
else {
min_dist = 0x200 ;
pred = 23552 ;
lsp_index [ 0 ] = lsp_index [ 1 ] = lsp_index [ 2 ] = 0 ;
}
cur_lsp [ 0 ] = lsp_band0 [ lsp_index [ 0 ] ] [ 0 ] ;
cur_lsp [ 1 ] = lsp_band0 [ lsp_index [ 0 ] ] [ 1 ] ;
cur_lsp [ 2 ] = lsp_band0 [ lsp_index [ 0 ] ] [ 2 ] ;
cur_lsp [ 3 ] = lsp_band1 [ lsp_index [ 1 ] ] [ 0 ] ;
cur_lsp [ 4 ] = lsp_band1 [ lsp_index [ 1 ] ] [ 1 ] ;
cur_lsp [ 5 ] = lsp_band1 [ lsp_index [ 1 ] ] [ 2 ] ;
cur_lsp [ 6 ] = lsp_band2 [ lsp_index [ 2 ] ] [ 0 ] ;
cur_lsp [ 7 ] = lsp_band2 [ lsp_index [ 2 ] ] [ 1 ] ;
cur_lsp [ 8 ] = lsp_band2 [ lsp_index [ 2 ] ] [ 2 ] ;
cur_lsp [ 9 ] = lsp_band2 [ lsp_index [ 2 ] ] [ 3 ] ;
for ( i = 0 ;
i < LPC_ORDER ;
i ++ ) {
temp = ( ( prev_lsp [ i ] - dc_lsp [ i ] ) * pred + ( 1 << 14 ) ) >> 15 ;
cur_lsp [ i ] += dc_lsp [ i ] + temp ;
}
for ( i = 0 ;
i < LPC_ORDER ;
i ++ ) {
cur_lsp [ 0 ] = FFMAX ( cur_lsp [ 0 ] , 0x180 ) ;
cur_lsp [ LPC_ORDER - 1 ] = FFMIN ( cur_lsp [ LPC_ORDER - 1 ] , 0x7e00 ) ;
for ( j = 1 ;
j < LPC_ORDER ;
j ++ ) {
temp = min_dist + cur_lsp [ j - 1 ] - cur_lsp [ j ] ;
if ( temp > 0 ) {
temp >>= 1 ;
cur_lsp [ j - 1 ] -= temp ;
cur_lsp [ j ] += temp ;
}
}
stable = 1 ;
for ( j = 1 ;
j < LPC_ORDER ;
j ++ ) {
temp = cur_lsp [ j - 1 ] + min_dist - cur_lsp [ j ] - 4 ;
if ( temp > 0 ) {
stable = 0 ;
break ;
}
}
if ( stable ) break ;
}
if ( ! stable ) memcpy ( cur_lsp , prev_lsp , LPC_ORDER * sizeof ( * cur_lsp ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_setup_scale_factors_for_frame ( struct scale_factors * sf , int other_w , int other_h , int this_w , int this_h ) {
if ( ! valid_ref_frame_size ( other_w , other_h , this_w , this_h ) ) {
sf -> x_scale_fp = REF_INVALID_SCALE ;
sf -> y_scale_fp = REF_INVALID_SCALE ;
return ;
}
sf -> x_scale_fp = get_fixed_point_scale_factor ( other_w , this_w ) ;
sf -> y_scale_fp = get_fixed_point_scale_factor ( other_h , this_h ) ;
sf -> x_step_q4 = scaled_x ( 16 , sf ) ;
sf -> y_step_q4 = scaled_y ( 16 , sf ) ;
if ( vp9_is_scaled ( sf ) ) {
sf -> scale_value_x = scaled_x ;
sf -> scale_value_y = scaled_y ;
}
else {
sf -> scale_value_x = unscaled_value ;
sf -> scale_value_y = unscaled_value ;
}
if ( sf -> x_step_q4 == 16 ) {
if ( sf -> y_step_q4 == 16 ) {
sf -> predict [ 0 ] [ 0 ] [ 0 ] = vp9_convolve_copy ;
sf -> predict [ 0 ] [ 0 ] [ 1 ] = vp9_convolve_avg ;
sf -> predict [ 0 ] [ 1 ] [ 0 ] = vp9_convolve8_vert ;
sf -> predict [ 0 ] [ 1 ] [ 1 ] = vp9_convolve8_avg_vert ;
sf -> predict [ 1 ] [ 0 ] [ 0 ] = vp9_convolve8_horiz ;
sf -> predict [ 1 ] [ 0 ] [ 1 ] = vp9_convolve8_avg_horiz ;
}
else {
sf -> predict [ 0 ] [ 0 ] [ 0 ] = vp9_convolve8_vert ;
sf -> predict [ 0 ] [ 0 ] [ 1 ] = vp9_convolve8_avg_vert ;
sf -> predict [ 0 ] [ 1 ] [ 0 ] = vp9_convolve8_vert ;
sf -> predict [ 0 ] [ 1 ] [ 1 ] = vp9_convolve8_avg_vert ;
sf -> predict [ 1 ] [ 0 ] [ 0 ] = vp9_convolve8 ;
sf -> predict [ 1 ] [ 0 ] [ 1 ] = vp9_convolve8_avg ;
}
}
else {
if ( sf -> y_step_q4 == 16 ) {
sf -> predict [ 0 ] [ 0 ] [ 0 ] = vp9_convolve8_horiz ;
sf -> predict [ 0 ] [ 0 ] [ 1 ] = vp9_convolve8_avg_horiz ;
sf -> predict [ 0 ] [ 1 ] [ 0 ] = vp9_convolve8 ;
sf -> predict [ 0 ] [ 1 ] [ 1 ] = vp9_convolve8_avg ;
sf -> predict [ 1 ] [ 0 ] [ 0 ] = vp9_convolve8_horiz ;
sf -> predict [ 1 ] [ 0 ] [ 1 ] = vp9_convolve8_avg_horiz ;
}
else {
sf -> predict [ 0 ] [ 0 ] [ 0 ] = vp9_convolve8 ;
sf -> predict [ 0 ] [ 0 ] [ 1 ] = vp9_convolve8_avg ;
sf -> predict [ 0 ] [ 1 ] [ 0 ] = vp9_convolve8 ;
sf -> predict [ 0 ] [ 1 ] [ 1 ] = vp9_convolve8_avg ;
sf -> predict [ 1 ] [ 0 ] [ 0 ] = vp9_convolve8 ;
sf -> predict [ 1 ] [ 0 ] [ 1 ] = vp9_convolve8_avg ;
}
}
sf -> predict [ 1 ] [ 1 ] [ 0 ] = vp9_convolve8 ;
sf -> predict [ 1 ] [ 1 ] [ 1 ] = vp9_convolve8_avg ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( DownloadExtensionTest , MAYBE_DownloadExtensionTest_AcceptDanger ) {
LoadExtension ( "downloads_split" ) ;
std : : unique_ptr < base : : Value > result ( RunFunctionAndReturnResult ( new DownloadsDownloadFunction ( ) , "[{
\"url\": \"data:,\", \"filename\": \"dangerous.swf\"}
]" ) ) ;
ASSERT_TRUE ( result . get ( ) ) ;
int result_id = - 1 ;
ASSERT_TRUE ( result -> GetAsInteger ( & result_id ) ) ;
DownloadItem * item = GetCurrentManager ( ) -> GetDownload ( result_id ) ;
ASSERT_TRUE ( item ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnChanged : : kEventName , base : : StringPrintf ( "[{
\"id\": %d, " " \"danger\": {
" " \"previous\": \"safe\"," " \"current\": \"file\"}
}
]" , result_id ) ) ) ;
ASSERT_TRUE ( item -> IsDangerous ( ) ) ;
ScopedCancellingItem canceller ( item ) ;
std : : unique_ptr < content : : DownloadTestObserver > observer ( new content : : DownloadTestObserverTerminal ( GetCurrentManager ( ) , 1 , content : : DownloadTestObserver : : ON_DANGEROUS_DOWNLOAD_IGNORE ) ) ;
DownloadsAcceptDangerFunction : : OnPromptCreatedCallback callback = base : : Bind ( & OnDangerPromptCreated ) ;
DownloadsAcceptDangerFunction : : OnPromptCreatedForTesting ( & callback ) ;
BrowserActionTestUtil : : Create ( browser ( ) ) -> Press ( 0 ) ;
observer -> WaitForFinished ( ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dtap_mm_loc_upd_rej ( 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_FALSE ;
ELEM_MAND_V ( GSM_A_PDU_TYPE_DTAP , DE_REJ_CAUSE , NULL ) ;
ELEM_OPT_TLV ( 0x36 , GSM_A_PDU_TYPE_DTAP , DE_MM_TIMER , " - T3246 value" ) ;
EXTRANEOUS_DATA_CHECK ( curr_len , 0 , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void read_sysvars ( void ) {
const struct ctl_var * v ;
struct ctl_var * kv ;
u_int n ;
u_int gotvar ;
const u_char * cs ;
char * valuep ;
const char * pch ;
u_char * wants ;
size_t wants_count ;
rpkt . status = htons ( ctlsysstatus ( ) ) ;
if ( res_authokay ) ctl_sys_num_events = 0 ;
wants_count = CS_MAXCODE + 1 + count_var ( ext_sys_var ) ;
wants = emalloc_zero ( wants_count ) ;
gotvar = 0 ;
while ( NULL != ( v = ctl_getitem ( sys_var , & valuep ) ) ) {
if ( ! ( EOV & v -> flags ) ) {
INSIST ( v -> code < wants_count ) ;
wants [ v -> code ] = 1 ;
gotvar = 1 ;
}
else {
v = ctl_getitem ( ext_sys_var , & valuep ) ;
INSIST ( v != NULL ) ;
if ( EOV & v -> flags ) {
ctl_error ( CERR_UNKNOWNVAR ) ;
free ( wants ) ;
return ;
}
n = v -> code + CS_MAXCODE + 1 ;
INSIST ( n < wants_count ) ;
wants [ n ] = 1 ;
gotvar = 1 ;
}
}
if ( gotvar ) {
for ( n = 1 ;
n <= CS_MAXCODE ;
n ++ ) if ( wants [ n ] ) ctl_putsys ( n ) ;
for ( n = 0 ;
n + CS_MAXCODE + 1 < wants_count ;
n ++ ) if ( wants [ n + CS_MAXCODE + 1 ] ) {
pch = ext_sys_var [ n ] . text ;
ctl_putdata ( pch , strlen ( pch ) , 0 ) ;
}
}
else {
for ( cs = def_sys_var ;
* cs != 0 ;
cs ++ ) ctl_putsys ( ( int ) * cs ) ;
for ( kv = ext_sys_var ;
kv && ! ( EOV & kv -> flags ) ;
kv ++ ) if ( DEF & kv -> flags ) ctl_putdata ( kv -> text , strlen ( kv -> text ) , 0 ) ;
}
free ( wants ) ;
ctl_flushpkt ( 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int proc_submiturb ( struct usb_dev_state * ps , void __user * arg ) {
struct usbdevfs_urb uurb ;
if ( copy_from_user ( & uurb , arg , sizeof ( uurb ) ) ) return - EFAULT ;
return proc_do_submiturb ( ps , & uurb , ( ( ( struct usbdevfs_urb __user * ) arg ) -> iso_frame_desc ) , arg ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void dissect_zcl_color_control_attr_data ( proto_tree * tree , tvbuff_t * tvb , guint * offset , guint16 attr_id , guint data_type ) {
static const int * capabilities_fields [ ] = {
& hf_zbee_zcl_color_control_attr_color_capabilities_hs , & hf_zbee_zcl_color_control_attr_color_capabilities_ehs , & hf_zbee_zcl_color_control_attr_color_capabilities_loop , & hf_zbee_zcl_color_control_attr_color_capabilities_xy , & hf_zbee_zcl_color_control_attr_color_capabilities_ct , NULL }
;
switch ( attr_id ) {
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_HUE : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_current_hue , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_SATURATION : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_current_saturation , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_REMAINING_TIME : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_remaining_time , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_DRIFT_COMPENSATION : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_drift_compensation , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMP : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_temperature , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_MODE : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_mode , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_NO_OF_PRIMARIES : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_nr_of_primaries , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_1_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_1_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_1_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_2_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_2_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_2_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_3_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_3_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_3_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_4_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_4_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_4_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_5_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_5_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_5_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_6_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_6_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_primary_6_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_white_point_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_white_point_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_red_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_red_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_red_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_green_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_green_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_green_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_X : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_blue_x , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_Y : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_blue_y , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_INTENSITY : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_blue_intensity , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_CURRENT_HUE : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_enhanced_current_hue , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_COLOR_MODE : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_enhanced_color_mode , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_ACTIVE : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_loop_active , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_DIRECTION : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_loop_direction , tvb , * offset , 1 , ENC_NA ) ;
* offset += 1 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_TIME : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_loop_time , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_START_ENH_HUE : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_loop_start_enhanced_hue , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_STORED_ENH_HUE : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_loop_stored_enhanced_hue , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_CAPABILITIES : proto_tree_add_bitmask ( tree , tvb , * offset , hf_zbee_zcl_color_control_attr_color_capabilities , ett_zbee_zcl_color_control_color_capabilities , capabilities_fields , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MIN : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_temperature_phys_min , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MAX : proto_tree_add_item ( tree , hf_zbee_zcl_color_control_attr_color_temperature_phys_max , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
break ;
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COMPENSATION_TEXT : default : dissect_zcl_attr_data ( tvb , tree , offset , data_type ) ;
break ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int proc_resetdevice ( struct usb_dev_state * ps ) {
struct usb_host_config * actconfig = ps -> dev -> actconfig ;
struct usb_interface * interface ;
int i , number ;
if ( ps -> privileges_dropped && actconfig ) {
for ( i = 0 ;
i < actconfig -> desc . bNumInterfaces ;
++ i ) {
interface = actconfig -> interface [ i ] ;
number = interface -> cur_altsetting -> desc . bInterfaceNumber ;
if ( usb_interface_claimed ( interface ) && ! test_bit ( number , & ps -> ifclaimed ) ) {
dev_warn ( & ps -> dev -> dev , "usbfs: interface %d claimed by %s while '%s' resets device\n" , number , interface -> dev . driver -> name , current -> comm ) ;
return - EACCES ;
}
}
}
return usb_reset_device ( ps -> dev ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_btgatt_microbit_led_matrix ( 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_led_matrix , tvb , 0 , tvb_captured_length ( tvb ) , ENC_NA ) ;
return tvb_captured_length ( tvb ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
List * make_ands_implicit ( Expr * clause ) {
if ( clause == NULL ) return NIL ;
else if ( and_clause ( ( Node * ) clause ) ) return ( ( BoolExpr * ) clause ) -> args ;
else if ( IsA ( clause , Const ) && ! ( ( Const * ) clause ) -> constisnull && DatumGetBool ( ( ( Const * ) clause ) -> constvalue ) ) return NIL ;
else return list_make1 ( clause ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int PEM_write_ ## name ( FILE * fp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# endif # define DECLARE_PEM_read_bio ( name , type ) type * PEM_read_bio_ ## name ( BIO * bp , type * * x , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x ) ;
# define DECLARE_PEM_write_bio_const ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , const type * x ) ;
# define DECLARE_PEM_write_cb_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write ( name , type ) DECLARE_PEM_write_bio ( name , type ) DECLARE_PEM_write_fp ( name , type ) # define DECLARE_PEM_write_const ( name , type ) DECLARE_PEM_write_bio_const ( name , type ) DECLARE_PEM_write_fp_const ( name , type ) # define DECLARE_PEM_write_cb ( name , type ) DECLARE_PEM_write_cb_bio ( name , type ) DECLARE_PEM_write_cb_fp ( name , type ) # define DECLARE_PEM_read ( name , type ) DECLARE_PEM_read_bio ( name , type ) DECLARE_PEM_read_fp ( name , type ) # define DECLARE_PEM_rw ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write ( name , type ) # define DECLARE_PEM_rw_const ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_const ( name , type ) # define DECLARE_PEM_rw_cb ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_cb ( name , type ) typedef int pem_password_cb ( char * buf , int size , int rwflag , void * userdata ) ;
int PEM_get_EVP_CIPHER_INFO ( char * header , EVP_CIPHER_INFO * cipher ) ;
int PEM_do_header ( EVP_CIPHER_INFO * cipher , unsigned char * data , long * len , pem_password_cb * callback , void * u ) ;
int PEM_read_bio ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len ) ;
# define PEM_FLAG_SECURE 0x1 # define PEM_FLAG_EAY_COMPATIBLE 0x2 # define PEM_FLAG_ONLY_B64 0x4 int PEM_read_bio_ex ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len , unsigned int flags ) ;
int PEM_bytes_read_bio_secmem ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
int PEM_write_bio ( BIO * bp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
int PEM_bytes_read_bio ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
void * PEM_ASN1_read_bio ( d2i_of_void * d2i , const char * name , BIO * bp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write_bio ( i2d_of_void * i2d , const char * name , BIO * bp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read_bio ( BIO * bp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
int PEM_X509_INFO_write_bio ( BIO * bp , X509_INFO * xi , EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cd , void * u ) ;
# ifndef OPENSSL_NO_STDIO int PEM_read ( FILE * fp , char * * name , char * * header , unsigned char * * data , long * len ) ;
int PEM_write ( FILE * fp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
void * PEM_ASN1_read ( d2i_of_void * d2i , const char * name , FILE * fp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write ( i2d_of_void * i2d , const char * name , FILE * fp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * callback , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read ( FILE * fp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
# endif int PEM_SignInit ( EVP_MD_CTX * ctx , EVP_MD * type ) ;
int PEM_SignUpdate ( EVP_MD_CTX * ctx , unsigned char * d , unsigned int cnt ) ;
int PEM_SignFinal ( EVP_MD_CTX * ctx , unsigned char * sigret , unsigned int * siglen , EVP_PKEY * pkey ) ;
int PEM_def_callback ( char * buf , int num , int rwflag , void * userdata ) ;
void PEM_proc_type ( char * buf , int type ) ;
void PEM_dek_info ( char * buf , const char * type , int len , char * str ) ;
# include < openssl / symhacks . h > DECLARE_PEM_rw ( X509 , X509 ) DECLARE_PEM_rw ( X509_AUX , X509 ) DECLARE_PEM_rw ( X509_REQ , X509_REQ ) DECLARE_PEM_write ( X509_REQ_NEW , X509_REQ ) DECLARE_PEM_rw ( X509_CRL , X509_CRL ) DECLARE_PEM_rw ( PKCS7 , PKCS7 ) DECLARE_PEM_rw ( NETSCAPE_CERT_SEQUENCE , NETSCAPE_CERT_SEQUENCE ) DECLARE_PEM_rw ( PKCS8 , X509_SIG ) DECLARE_PEM_rw ( PKCS8_PRIV_KEY_INFO , PKCS8_PRIV_KEY_INFO ) # ifndef OPENSSL_NO_RSA DECLARE_PEM_rw_cb ( RSAPrivateKey , RSA ) DECLARE_PEM_rw_const ( RSAPublicKey , RSA ) DECLARE_PEM_rw ( RSA_PUBKEY , RSA ) # endif # ifndef OPENSSL_NO_DSA DECLARE_PEM_rw_cb ( DSAPrivateKey , DSA ) DECLARE_PEM_rw ( DSA_PUBKEY , DSA ) DECLARE_PEM_rw_const ( DSAparams , DSA ) # endif # ifndef OPENSSL_NO_EC DECLARE_PEM_rw_const ( ECPKParameters , EC_GROUP ) DECLARE_PEM_rw_cb ( ECPrivateKey , EC_KEY ) DECLARE_PEM_rw ( EC_PUBKEY , EC_KEY ) # endif # ifndef OPENSSL_NO_DH DECLARE_PEM_rw_const ( DHparams , DH ) DECLARE_PEM_write_const ( DHxparams , DH ) # endif DECLARE_PEM_rw_cb ( PrivateKey , EVP_PKEY )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void variance ( const uint8_t * a , int a_stride , const uint8_t * b , int b_stride , int w , int h , unsigned int * sse , int * sum ) {
int i , j ;
* sum = 0 ;
* sse = 0 ;
for ( i = 0 ;
i < h ;
i ++ ) {
for ( j = 0 ;
j < w ;
j ++ ) {
const int diff = a [ j ] - b [ j ] ;
* sum += diff ;
* sse += diff * diff ;
}
a += a_stride ;
b += b_stride ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_ber_T_encoding ( gboolean implicit_tag _U_ , tvbuff_t * tvb , int offset , asn1_ctx_t * actx , proto_tree * tree , int hf_index ) {
offset = dissect_ber_choice ( actx , tree , tvb , offset , T_encoding_choice , hf_index , ett_ber_T_encoding , & actx -> external . encoding ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void jpc_ns_invlift_row ( jpc_fix_t * a , int numcols , int parity ) {
register jpc_fix_t * lptr ;
register jpc_fix_t * hptr ;
register int n ;
int llen ;
llen = ( numcols + 1 - parity ) >> 1 ;
if ( numcols > 1 ) {
# if defined ( WT_DOSCALE ) lptr = & a [ 0 ] ;
n = llen ;
while ( n -- > 0 ) {
lptr [ 0 ] = jpc_fix_mul ( lptr [ 0 ] , jpc_dbltofix ( 1.0 / LGAIN ) ) ;
++ lptr ;
}
hptr = & a [ llen ] ;
n = numcols - llen ;
while ( n -- > 0 ) {
hptr [ 0 ] = jpc_fix_mul ( hptr [ 0 ] , jpc_dbltofix ( 1.0 / HGAIN ) ) ;
++ hptr ;
}
# endif lptr = & a [ 0 ] ;
hptr = & a [ llen ] ;
if ( ! parity ) {
jpc_fix_minuseq ( lptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * DELTA ) , hptr [ 0 ] ) ) ;
++ lptr ;
}
n = llen - ( ! parity ) - ( parity != ( numcols & 1 ) ) ;
while ( n -- > 0 ) {
jpc_fix_minuseq ( lptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( DELTA ) , jpc_fix_add ( hptr [ 0 ] , hptr [ 1 ] ) ) ) ;
++ lptr ;
++ hptr ;
}
if ( parity != ( numcols & 1 ) ) {
jpc_fix_minuseq ( lptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * DELTA ) , hptr [ 0 ] ) ) ;
}
lptr = & a [ 0 ] ;
hptr = & a [ llen ] ;
if ( parity ) {
jpc_fix_minuseq ( hptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * GAMMA ) , lptr [ 0 ] ) ) ;
++ hptr ;
}
n = numcols - llen - parity - ( parity == ( numcols & 1 ) ) ;
while ( n -- > 0 ) {
jpc_fix_minuseq ( hptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( GAMMA ) , jpc_fix_add ( lptr [ 0 ] , lptr [ 1 ] ) ) ) ;
++ hptr ;
++ lptr ;
}
if ( parity == ( numcols & 1 ) ) {
jpc_fix_minuseq ( hptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * GAMMA ) , lptr [ 0 ] ) ) ;
}
lptr = & a [ 0 ] ;
hptr = & a [ llen ] ;
if ( ! parity ) {
jpc_fix_minuseq ( lptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * BETA ) , hptr [ 0 ] ) ) ;
++ lptr ;
}
n = llen - ( ! parity ) - ( parity != ( numcols & 1 ) ) ;
while ( n -- > 0 ) {
jpc_fix_minuseq ( lptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( BETA ) , jpc_fix_add ( hptr [ 0 ] , hptr [ 1 ] ) ) ) ;
++ lptr ;
++ hptr ;
}
if ( parity != ( numcols & 1 ) ) {
jpc_fix_minuseq ( lptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * BETA ) , hptr [ 0 ] ) ) ;
}
lptr = & a [ 0 ] ;
hptr = & a [ llen ] ;
if ( parity ) {
jpc_fix_minuseq ( hptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * ALPHA ) , lptr [ 0 ] ) ) ;
++ hptr ;
}
n = numcols - llen - parity - ( parity == ( numcols & 1 ) ) ;
while ( n -- > 0 ) {
jpc_fix_minuseq ( hptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( ALPHA ) , jpc_fix_add ( lptr [ 0 ] , lptr [ 1 ] ) ) ) ;
++ hptr ;
++ lptr ;
}
if ( parity == ( numcols & 1 ) ) {
jpc_fix_minuseq ( hptr [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * ALPHA ) , lptr [ 0 ] ) ) ;
}
}
else {
# if defined ( WT_LENONE ) if ( parity ) {
lptr = & a [ 0 ] ;
lptr [ 0 ] = jpc_fix_asr ( lptr [ 0 ] , 1 ) ;
}
# endif }
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void end_header ( AVIOContext * pb , int64_t pos ) {
int64_t pos1 ;
pos1 = avio_tell ( pb ) ;
avio_seek ( pb , pos + 16 , SEEK_SET ) ;
avio_wl64 ( pb , pos1 - pos ) ;
avio_seek ( pb , pos1 , SEEK_SET ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( SupervisedUserNavigationThrottleTest , BlockMainFrameWithInterstitial ) {
BlockHost ( kExampleHost2 ) ;
WebContents * tab = browser ( ) -> tab_strip_model ( ) -> GetActiveWebContents ( ) ;
GURL allowed_url = embedded_test_server ( ) -> GetURL ( kExampleHost , "/supervised_user/simple.html" ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , allowed_url ) ;
EXPECT_FALSE ( tab -> ShowingInterstitialPage ( ) ) ;
GURL blocked_url = embedded_test_server ( ) -> GetURL ( kExampleHost2 , "/supervised_user/simple.html" ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , blocked_url ) ;
EXPECT_TRUE ( tab -> ShowingInterstitialPage ( ) ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static time_t xstrpisotime ( const char * s , char * * endptr ) {
struct tm tm ;
time_t res = ( time_t ) - 1 ;
memset ( & tm , 0 , sizeof ( tm ) ) ;
while ( * s == ' ' || * s == '\t' ) ++ s ;
if ( ( tm . tm_year = strtoi_lim ( s , & s , 1583 , 4095 ) ) < 0 || * s ++ != '-' ) {
goto out ;
}
if ( ( tm . tm_mon = strtoi_lim ( s , & s , 1 , 12 ) ) < 0 || * s ++ != '-' ) {
goto out ;
}
if ( ( tm . tm_mday = strtoi_lim ( s , & s , 1 , 31 ) ) < 0 || * s ++ != 'T' ) {
goto out ;
}
if ( ( tm . tm_hour = strtoi_lim ( s , & s , 0 , 23 ) ) < 0 || * s ++ != ':' ) {
goto out ;
}
if ( ( tm . tm_min = strtoi_lim ( s , & s , 0 , 59 ) ) < 0 || * s ++ != ':' ) {
goto out ;
}
if ( ( tm . tm_sec = strtoi_lim ( s , & s , 0 , 60 ) ) < 0 || * s ++ != 'Z' ) {
goto out ;
}
tm . tm_year -= 1900 ;
tm . tm_mon -- ;
res = time_from_tm ( & tm ) ;
out : if ( endptr != NULL ) {
* endptr = deconst ( s ) ;
}
return res ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static SplineSet * SCttfApprox ( SplineChar * sc , int layer ) {
SplineSet * head = NULL , * last , * ss , * tss ;
RefChar * ref ;
for ( ss = sc -> layers [ layer ] . splines ;
ss != NULL ;
ss = ss -> next ) {
tss = sc -> layers [ layer ] . order2 ? SplinePointListCopy1 ( ss ) : SSttfApprox ( ss ) ;
if ( head == NULL ) head = tss ;
else last -> next = tss ;
last = tss ;
}
for ( ref = sc -> layers [ layer ] . refs ;
ref != NULL ;
ref = ref -> next ) {
for ( ss = ref -> layers [ 0 ] . splines ;
ss != NULL ;
ss = ss -> next ) {
tss = sc -> layers [ layer ] . order2 ? SplinePointListCopy1 ( ss ) : SSttfApprox ( ss ) ;
if ( head == NULL ) head = tss ;
else last -> next = tss ;
last = tss ;
}
}
return ( head ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline int inode_doinit ( struct inode * inode ) {
return inode_doinit_with_dentry ( inode , NULL ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int com_status ( String * buffer __attribute__ ( ( unused ) ) , char * line __attribute__ ( ( unused ) ) ) {
const char * status_str ;
char buff [ 40 ] ;
ulonglong id ;
MYSQL_RES * result ;
LINT_INIT ( result ) ;
if ( mysql_real_query_for_lazy ( C_STRING_WITH_LEN ( "select DATABASE(), USER() limit 1" ) ) ) return 0 ;
tee_puts ( "--------------" , stdout ) ;
usage ( 1 ) ;
tee_fprintf ( stdout , "\nConnection id:\t\t%lu\n" , mysql_thread_id ( & mysql ) ) ;
if ( ! mysql_store_result_for_lazy ( & result ) ) {
MYSQL_ROW cur = mysql_fetch_row ( result ) ;
if ( cur ) {
tee_fprintf ( stdout , "Current database:\t%s\n" , cur [ 0 ] ? cur [ 0 ] : "" ) ;
tee_fprintf ( stdout , "Current user:\t\t%s\n" , cur [ 1 ] ) ;
}
mysql_free_result ( result ) ;
}
# if defined ( HAVE_OPENSSL ) && ! defined ( EMBEDDED_LIBRARY ) if ( ( status_str = mysql_get_ssl_cipher ( & mysql ) ) ) tee_fprintf ( stdout , "SSL:\t\t\tCipher in use is %s\n" , status_str ) ;
else # endif tee_puts ( "SSL:\t\t\tNot in use" , stdout ) ;
if ( skip_updates ) {
my_vidattr ( A_BOLD ) ;
tee_fprintf ( stdout , "\nAll updates ignored to this database\n" ) ;
my_vidattr ( A_NORMAL ) ;
}
# ifdef USE_POPEN tee_fprintf ( stdout , "Current pager:\t\t%s\n" , pager ) ;
tee_fprintf ( stdout , "Using outfile:\t\t'%s'\n" , opt_outfile ? outfile : "" ) ;
# endif tee_fprintf ( stdout , "Using delimiter:\t%s\n" , delimiter ) ;
tee_fprintf ( stdout , "Server:\t\t\t%s\n" , mysql_get_server_name ( & mysql ) ) ;
tee_fprintf ( stdout , "Server version:\t\t%s\n" , server_version_string ( & mysql ) ) ;
tee_fprintf ( stdout , "Protocol version:\t%d\n" , mysql_get_proto_info ( & mysql ) ) ;
tee_fprintf ( stdout , "Connection:\t\t%s\n" , mysql_get_host_info ( & mysql ) ) ;
if ( ( id = mysql_insert_id ( & mysql ) ) ) tee_fprintf ( stdout , "Insert id:\t\t%s\n" , llstr ( id , buff ) ) ;
if ( mysql_real_query_for_lazy ( C_STRING_WITH_LEN ( "select @@character_set_client, @@character_set_connection, " "@@character_set_server, @@character_set_database limit 1" ) ) ) {
if ( mysql_errno ( & mysql ) == CR_SERVER_GONE_ERROR ) return 0 ;
}
if ( ! mysql_store_result_for_lazy ( & result ) ) {
MYSQL_ROW cur = mysql_fetch_row ( result ) ;
if ( cur ) {
tee_fprintf ( stdout , "Server characterset:\t%s\n" , cur [ 2 ] ? cur [ 2 ] : "" ) ;
tee_fprintf ( stdout , "Db characterset:\t%s\n" , cur [ 3 ] ? cur [ 3 ] : "" ) ;
tee_fprintf ( stdout , "Client characterset:\t%s\n" , cur [ 0 ] ? cur [ 0 ] : "" ) ;
tee_fprintf ( stdout , "Conn. characterset:\t%s\n" , cur [ 1 ] ? cur [ 1 ] : "" ) ;
}
mysql_free_result ( result ) ;
}
else {
tee_fprintf ( stdout , "Client characterset:\t%s\n" , charset_info -> csname ) ;
tee_fprintf ( stdout , "Server characterset:\t%s\n" , mysql . charset -> csname ) ;
}
# ifndef EMBEDDED_LIBRARY if ( strstr ( mysql_get_host_info ( & mysql ) , "TCP/IP" ) || ! mysql . unix_socket ) tee_fprintf ( stdout , "TCP port:\t\t%d\n" , mysql . port ) ;
else tee_fprintf ( stdout , "UNIX socket:\t\t%s\n" , mysql . unix_socket ) ;
if ( mysql . net . compress ) tee_fprintf ( stdout , "Protocol:\t\tCompressed\n" ) ;
# endif if ( ( status_str = mysql_stat ( & mysql ) ) && ! mysql_error ( & mysql ) [ 0 ] ) {
ulong sec ;
const char * pos = strchr ( status_str , ' ' ) ;
tee_fprintf ( stdout , "%.*s\t\t\t" , ( int ) ( pos - status_str ) , status_str ) ;
if ( ( status_str = str2int ( pos , 10 , 0 , LONG_MAX , ( long * ) & sec ) ) ) {
nice_time ( ( double ) sec , buff , 0 ) ;
tee_puts ( buff , stdout ) ;
while ( * status_str == ' ' ) status_str ++ ;
tee_putc ( '\n' , stdout ) ;
tee_puts ( status_str , stdout ) ;
}
}
if ( safe_updates ) {
my_vidattr ( A_BOLD ) ;
tee_fprintf ( stdout , "\nNote that you are running in safe_update_mode:\n" ) ;
my_vidattr ( A_NORMAL ) ;
tee_fprintf ( stdout , "\ UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\ (One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n\ SELECT has an automatic 'LIMIT %lu' if LIMIT is not used.\n\ Max number of examined row combination in a join is set to: %lu\n\n" , select_limit , max_join_size ) ;
}
tee_puts ( "--------------\n" , stdout ) ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void notify_job_time_cb ( packet_info * pinfo _U_ , proto_tree * tree _U_ , proto_item * item , dcerpc_info * di , tvbuff_t * tvb _U_ , int start_offset _U_ , int end_offset _U_ , void * callback_args _U_ ) {
dcerpc_call_value * dcv = ( dcerpc_call_value * ) di -> call_data ;
char * str = ( char * ) dcv -> private_data ;
proto_item_append_text ( item , ": %s" , str ) ;
if ( item ) proto_item_append_text ( item -> parent , ": %s" , str ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline int mpc8_get_mod_golomb ( GetBitContext * gb , int m ) {
if ( mpc8_cnk_len [ 0 ] [ m ] < 1 ) return 0 ;
return mpc8_dec_base ( gb , 1 , m + 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static uint32_t gic_cpu_read ( GICState * s , int cpu , int offset ) {
switch ( offset ) {
case 0x00 : return s -> cpu_enabled [ cpu ] ;
case 0x04 : return s -> priority_mask [ cpu ] ;
case 0x08 : return 0 ;
case 0x0c : return gic_acknowledge_irq ( s , cpu ) ;
case 0x14 : return s -> running_priority [ cpu ] ;
case 0x18 : return s -> current_pending [ cpu ] ;
default : qemu_log_mask ( LOG_GUEST_ERROR , "gic_cpu_read: Bad offset %x\n" , ( int ) offset ) ;
return 0 ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static const char * cmd_argument_separator ( cmd_parms * cmd , void * _dcfg , const char * p1 ) {
directory_config * dcfg = ( directory_config * ) _dcfg ;
if ( strlen ( p1 ) != 1 ) {
return apr_psprintf ( cmd -> pool , "ModSecurity: Invalid argument separator: %s" , p1 ) ;
}
dcfg -> argument_separator = p1 [ 0 ] ;
return NULL ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static hb_codepoint_t hb_icu_unicode_mirroring ( hb_unicode_funcs_t * ufuncs HB_UNUSED , hb_codepoint_t unicode , void * user_data HB_UNUSED ) {
return u_charMirror ( unicode ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static enum ETokenType getStringToken ( UCHARBUF * buf , UChar32 initialChar , struct UString * token , UErrorCode * status ) {
UBool lastStringWasQuoted ;
UChar32 c ;
UChar target [ 3 ] = {
'\0' }
;
UChar * pTarget = target ;
int len = 0 ;
UBool isFollowingCharEscaped = FALSE ;
UBool isNLUnescaped = FALSE ;
UChar32 prevC = 0 ;
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
lastStringWasQuoted = FALSE ;
c = initialChar ;
ustr_setlen ( token , 0 , status ) ;
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
for ( ;
;
) {
if ( c == QUOTE ) {
if ( ! lastStringWasQuoted && token -> fLength > 0 ) {
ustr_ucat ( token , SPACE , status ) ;
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
}
lastStringWasQuoted = TRUE ;
for ( ;
;
) {
c = ucbuf_getc ( buf , status ) ;
if ( c == U_EOF ) {
return TOK_EOF ;
}
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
if ( c == QUOTE && ! isFollowingCharEscaped ) {
break ;
}
if ( c == ESCAPE && ! isFollowingCharEscaped ) {
pTarget = target ;
c = unescape ( buf , status ) ;
if ( c == U_ERR ) {
return TOK_ERROR ;
}
if ( c == CR || c == LF ) {
isNLUnescaped = TRUE ;
}
}
if ( c == ESCAPE && ! isFollowingCharEscaped ) {
isFollowingCharEscaped = TRUE ;
}
else {
U_APPEND_CHAR32 ( c , pTarget , len ) ;
pTarget = target ;
ustr_uscat ( token , pTarget , len , status ) ;
isFollowingCharEscaped = FALSE ;
len = 0 ;
if ( c == CR || c == LF ) {
if ( isNLUnescaped == FALSE && prevC != CR ) {
lineCount ++ ;
}
isNLUnescaped = FALSE ;
}
}
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
prevC = c ;
}
}
else {
if ( token -> fLength > 0 ) {
ustr_ucat ( token , SPACE , status ) ;
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
}
if ( lastStringWasQuoted ) {
if ( getShowWarning ( ) ) {
warning ( lineCount , "Mixing quoted and unquoted strings" ) ;
}
if ( isStrict ( ) ) {
return TOK_ERROR ;
}
}
lastStringWasQuoted = FALSE ;
if ( c == ESCAPE ) {
pTarget = target ;
c = unescape ( buf , status ) ;
if ( c == U_EOF ) {
return TOK_ERROR ;
}
}
U_APPEND_CHAR32 ( c , pTarget , len ) ;
pTarget = target ;
ustr_uscat ( token , pTarget , len , status ) ;
len = 0 ;
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
for ( ;
;
) {
c = getNextChar ( buf , FALSE , NULL , status ) ;
if ( c == U_EOF ) {
ucbuf_ungetc ( c , buf ) ;
return TOK_STRING ;
}
if ( U_FAILURE ( * status ) ) {
return TOK_STRING ;
}
if ( c == QUOTE || c == OPENBRACE || c == CLOSEBRACE || c == COMMA || c == COLON ) {
ucbuf_ungetc ( c , buf ) ;
break ;
}
if ( isWhitespace ( c ) ) {
break ;
}
if ( c == ESCAPE ) {
pTarget = target ;
c = unescape ( buf , status ) ;
if ( c == U_ERR ) {
return TOK_ERROR ;
}
}
U_APPEND_CHAR32 ( c , pTarget , len ) ;
pTarget = target ;
ustr_uscat ( token , pTarget , len , status ) ;
len = 0 ;
if ( U_FAILURE ( * status ) ) {
return TOK_ERROR ;
}
}
}
c = getNextChar ( buf , TRUE , NULL , status ) ;
if ( U_FAILURE ( * status ) ) {
return TOK_STRING ;
}
if ( c == OPENBRACE || c == CLOSEBRACE || c == COMMA || c == COLON ) {
ucbuf_ungetc ( c , buf ) ;
return TOK_STRING ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static kadm5_ret_t add_to_history ( krb5_context context , krb5_kvno hist_kvno , osa_princ_ent_t adb , kadm5_policy_ent_t pol , osa_pw_hist_ent * pw ) {
osa_pw_hist_ent * histp ;
uint32_t nhist ;
unsigned int i , knext , nkeys ;
nhist = pol -> pw_history_num ;
if ( nhist <= 1 ) return 0 ;
if ( adb -> admin_history_kvno != hist_kvno ) {
free ( adb -> old_keys ) ;
adb -> old_keys = NULL ;
adb -> old_key_len = 0 ;
adb -> old_key_next = 0 ;
adb -> admin_history_kvno = hist_kvno ;
}
nkeys = adb -> old_key_len ;
knext = adb -> old_key_next ;
if ( nkeys + 1 < nhist ) {
if ( adb -> old_keys == NULL ) {
adb -> old_keys = ( osa_pw_hist_ent * ) malloc ( ( nkeys + 1 ) * sizeof ( osa_pw_hist_ent ) ) ;
}
else {
adb -> old_keys = ( osa_pw_hist_ent * ) realloc ( adb -> old_keys , ( nkeys + 1 ) * sizeof ( osa_pw_hist_ent ) ) ;
}
if ( adb -> old_keys == NULL ) return ( ENOMEM ) ;
memset ( & adb -> old_keys [ nkeys ] , 0 , sizeof ( osa_pw_hist_ent ) ) ;
nkeys = ++ adb -> old_key_len ;
for ( i = nkeys - 1 ;
i > knext ;
i -- ) {
adb -> old_keys [ i ] = adb -> old_keys [ i - 1 ] ;
}
memset ( & adb -> old_keys [ knext ] , 0 , sizeof ( osa_pw_hist_ent ) ) ;
}
else if ( nkeys + 1 > nhist ) {
int j ;
osa_pw_hist_t tmp ;
tmp = ( osa_pw_hist_ent * ) malloc ( ( nhist - 1 ) * sizeof ( osa_pw_hist_ent ) ) ;
if ( tmp == NULL ) return ENOMEM ;
for ( i = 0 ;
i < nhist - 1 ;
i ++ ) {
j = ( i + nkeys + knext - ( nhist - 1 ) ) % nkeys ;
tmp [ i ] = adb -> old_keys [ j ] ;
}
for ( i = 0 ;
i < nkeys - ( nhist - 1 ) ;
i ++ ) {
j = ( i + nkeys + knext ) % nkeys ;
histp = & adb -> old_keys [ j ] ;
for ( j = 0 ;
j < histp -> n_key_data ;
j ++ ) {
krb5_free_key_data_contents ( context , & histp -> key_data [ j ] ) ;
}
free ( histp -> key_data ) ;
}
free ( adb -> old_keys ) ;
adb -> old_keys = tmp ;
nkeys = adb -> old_key_len = nhist - 1 ;
knext = adb -> old_key_next = 0 ;
}
if ( knext + 1 > nkeys ) knext = adb -> old_key_next = 0 ;
histp = & adb -> old_keys [ knext ] ;
for ( i = 0 ;
i < ( unsigned int ) histp -> n_key_data ;
i ++ ) krb5_free_key_data_contents ( context , & histp -> key_data [ i ] ) ;
free ( histp -> key_data ) ;
adb -> old_keys [ knext ] = * pw ;
if ( ++ adb -> old_key_next == nhist - 1 ) adb -> old_key_next = 0 ;
return ( 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_FEC_mode ( 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_FEC_mode , FEC_mode_choice , NULL ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dumpcmap ( struct alltabs * at , SplineFont * sf , enum fontformat format ) {
int i , enccnt , issmall , hasmac ;
uint16 table [ 256 ] ;
SplineChar * sc ;
int alreadyprivate = false ;
int wasotf = format == ff_otf || format == ff_otfcid ;
EncMap * map = at -> map ;
int ucs4len = 0 , ucs2len = 0 , cjklen = 0 , applecjklen = 0 , vslen = 0 ;
FILE * format12 , * format4 , * format2 , * apple2 , * format14 ;
int mspos , ucs4pos , cjkpos , applecjkpos , vspos , start_of_macroman ;
int modformat = format ;
if ( ( format >= ff_ttf && format <= ff_otfdfont ) && ( at -> gi . flags & ttf_flag_symbol ) ) modformat = ff_ttfsym ;
at -> cmap = tmpfile ( ) ;
memset ( table , '\0' , sizeof ( table ) ) ;
if ( ! wasotf ) {
table [ 29 ] = table [ 8 ] = table [ 0 ] = 1 ;
table [ 9 ] = table [ 13 ] = 2 ;
}
for ( i = 0 ;
i < 256 ;
++ i ) {
sc = SFGetChar ( sf , MacRomanEnc [ i ] , NULL ) ;
if ( sc != NULL && sc -> ttf_glyph != - 1 ) table [ i ] = sc -> ttf_glyph ;
}
if ( table [ 0 ] == 0 ) table [ 0 ] = 1 ;
if ( modformat == ff_ttfsym ) {
alreadyprivate = AlreadyMSSymbolArea ( sf , map ) ;
memset ( table , '\0' , sizeof ( table ) ) ;
if ( ! wasotf ) {
table [ 29 ] = table [ 8 ] = table [ 0 ] = 1 ;
table [ 9 ] = table [ 13 ] = 2 ;
}
if ( ! alreadyprivate ) {
for ( i = 0 ;
i < map -> enccount && i < 256 ;
++ i ) {
if ( map -> map [ i ] != - 1 && ( sc = sf -> glyphs [ map -> map [ i ] ] ) != NULL && sc -> ttf_glyph != - 1 ) table [ i ] = sc -> ttf_glyph ;
}
for ( i = 0xf020 ;
i <= 0xf0ff && i < sf -> glyphcnt ;
++ i ) {
if ( map -> map [ i ] != - 1 && ( sc = sf -> glyphs [ map -> map [ i ] ] ) != NULL && sc -> ttf_glyph != - 1 && table [ i - 0xf000 ] == 0 ) table [ i - 0xf000 ] = sc -> ttf_glyph ;
}
}
else {
for ( i = 0xf020 ;
i <= 0xf0ff && i < sf -> glyphcnt ;
++ i ) {
if ( map -> map [ i ] != - 1 && ( sc = sf -> glyphs [ map -> map [ i ] ] ) != NULL && sc -> ttf_glyph != - 1 ) table [ i - 0xf000 ] = sc -> ttf_glyph ;
}
for ( i = 0 ;
i < map -> enccount && i < 256 ;
++ i ) {
if ( map -> map [ i ] != - 1 && ( sc = sf -> glyphs [ map -> map [ i ] ] ) != NULL && sc -> ttf_glyph != - 1 && table [ i ] == 0 ) table [ i ] = sc -> ttf_glyph ;
}
}
if ( ! alreadyprivate ) {
for ( i = 0 ;
i < map -> enccount && i < 256 ;
++ i ) {
if ( map -> map [ i ] != - 1 && ( sc = sf -> glyphs [ map -> map [ i ] ] ) != NULL ) {
sc -> orig_pos = sc -> unicodeenc ;
sc -> unicodeenc = 0xf000 + i ;
}
}
for ( ;
i < map -> enccount ;
++ i ) {
if ( map -> map [ i ] != - 1 && ( sc = sf -> glyphs [ map -> map [ i ] ] ) != NULL ) {
sc -> orig_pos = sc -> unicodeenc ;
sc -> unicodeenc = - 1 ;
}
}
}
}
format4 = NeedsUCS2Table ( sf , & ucs2len , map , modformat == ff_ttfsym ) ;
apple2 = NULL ;
if ( modformat != ff_ttfsym ) {
format12 = NeedsUCS4Table ( sf , & ucs4len , map ) ;
format2 = Needs816Enc ( sf , & cjklen , map , & apple2 , & applecjklen ) ;
format14 = NeedsVariationSequenceTable ( sf , & vslen ) ;
}
else format12 = format2 = format14 = apple2 = NULL ;
if ( modformat == ff_ttfsym ) {
enccnt = 2 ;
hasmac = 0 ;
}
else {
hasmac = 1 ;
enccnt = 3 ;
if ( format12 != NULL ) enccnt = 5 ;
if ( format2 != NULL ) {
if ( strstrmatch ( map -> enc -> enc_name , "johab" ) != NULL ) {
++ enccnt ;
}
else {
enccnt += 2 ;
hasmac = 3 ;
}
}
if ( format14 != NULL ) ++ enccnt ;
}
putshort ( at -> cmap , 0 ) ;
putshort ( at -> cmap , enccnt ) ;
mspos = 2 * sizeof ( uint16 ) + enccnt * ( 2 * sizeof ( uint16 ) + sizeof ( uint32 ) ) ;
ucs4pos = mspos + ucs2len ;
cjkpos = ucs4pos + ucs4len ;
if ( apple2 == NULL ) {
applecjkpos = cjkpos ;
applecjklen = cjklen ;
}
else applecjkpos = cjkpos + cjklen ;
vspos = applecjkpos + applecjklen ;
start_of_macroman = vspos + vslen ;
if ( hasmac & 1 ) {
putshort ( at -> cmap , 0 ) ;
putshort ( at -> cmap , 3 ) ;
putlong ( at -> cmap , mspos ) ;
}
if ( format12 != NULL ) {
putshort ( at -> cmap , 0 ) ;
putshort ( at -> cmap , 4 ) ;
putlong ( at -> cmap , ucs4pos ) ;
}
if ( format14 != NULL ) {
putshort ( at -> cmap , 0 ) ;
putshort ( at -> cmap , 5 ) ;
putlong ( at -> cmap , vspos ) ;
}
putshort ( at -> cmap , 1 ) ;
putshort ( at -> cmap , 0 ) ;
putlong ( at -> cmap , start_of_macroman ) ;
if ( format2 != NULL && ( hasmac & 2 ) ) {
putshort ( at -> cmap , 1 ) ;
putshort ( at -> cmap , map -> enc -> is_japanese || sf -> uni_interp == ui_japanese ? 1 : map -> enc -> is_korean || sf -> uni_interp == ui_korean ? 3 : map -> enc -> is_simplechinese || sf -> uni_interp == ui_simp_chinese ? 25 : ) ;
putlong ( at -> cmap , applecjkpos ) ;
}
putshort ( at -> cmap , 3 ) ;
putshort ( at -> cmap , modformat == ff_ttfsym ? 0 : ) ;
putlong ( at -> cmap , mspos ) ;
if ( format2 != NULL ) {
putshort ( at -> cmap , 3 ) ;
putshort ( at -> cmap , strstrmatch ( map -> enc -> enc_name , "johab" ) != NULL ? 6 : map -> enc -> is_korean || sf -> uni_interp == ui_korean ? 5 : map -> enc -> is_japanese || sf -> uni_interp == ui_japanese ? 2 : map -> enc -> is_simplechinese || sf -> uni_interp == ui_simp_chinese ? 3 : 4 ) ;
putlong ( at -> cmap , cjkpos ) ;
}
if ( format12 != NULL ) {
putshort ( at -> cmap , 3 ) ;
putshort ( at -> cmap , 10 ) ;
putlong ( at -> cmap , ucs4pos ) ;
}
if ( format4 != NULL ) {
if ( ! ttfcopyfile ( at -> cmap , format4 , mspos , "cmap-Unicode16" ) ) at -> error = true ;
}
if ( format12 != NULL ) {
if ( ! ttfcopyfile ( at -> cmap , format12 , ucs4pos , "cmap-Unicode32" ) ) at -> error = true ;
}
if ( format2 != NULL ) {
if ( ! ttfcopyfile ( at -> cmap , format2 , cjkpos , "cmap-cjk" ) ) at -> error = true ;
}
if ( apple2 != NULL ) {
if ( ! ttfcopyfile ( at -> cmap , apple2 , applecjkpos , "cmap-applecjk" ) ) at -> error = true ;
}
if ( format14 != NULL ) {
if ( ! ttfcopyfile ( at -> cmap , format14 , vspos , "cmap-uniVariations" ) ) at -> error = true ;
}
issmall = true ;
for ( i = 0 ;
i < 256 ;
++ i ) if ( table [ i ] >= 256 ) {
issmall = false ;
break ;
}
if ( issmall ) {
putshort ( at -> cmap , 0 ) ;
putshort ( at -> cmap , 262 ) ;
putshort ( at -> cmap , 0 ) ;
for ( i = 0 ;
i < 256 ;
++ i ) putc ( table [ i ] , at -> cmap ) ;
}
else {
putshort ( at -> cmap , 6 ) ;
putshort ( at -> cmap , 522 ) ;
putshort ( at -> cmap , 0 ) ;
putshort ( at -> cmap , 0 ) ;
putshort ( at -> cmap , 256 ) ;
for ( i = 0 ;
i < 256 ;
++ i ) putshort ( at -> cmap , table [ i ] ) ;
}
at -> cmaplen = ftell ( at -> cmap ) ;
if ( ( at -> cmaplen & 2 ) != 0 ) putshort ( at -> cmap , 0 ) ;
if ( modformat == ff_ttfsym ) {
if ( ! alreadyprivate ) {
for ( i = 0 ;
i < sf -> glyphcnt ;
++ i ) if ( sf -> glyphs [ i ] != NULL ) {
sf -> glyphs [ i ] -> unicodeenc = sf -> glyphs [ i ] -> orig_pos ;
sf -> glyphs [ i ] -> orig_pos = i ;
}
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static uintmax_t change_note_fanout ( struct tree_entry * root , unsigned char fanout ) {
char hex_sha1 [ 40 ] , path [ 60 ] ;
return do_change_note_fanout ( root , root , hex_sha1 , 0 , path , 0 , fanout ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( PrefsFunctionalTest , TestHomepagePrefs ) {
GURL home_page_url ( "http://www.google.com" ) ;
PrefService * prefs = browser ( ) -> profile ( ) -> GetPrefs ( ) ;
EXPECT_FALSE ( prefs -> GetBoolean ( prefs : : kHomePageIsNewTabPage ) ) ;
EXPECT_EQ ( home_page_url . spec ( ) , prefs -> GetString ( prefs : : kHomePage ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
fz_pixmap_converter * fz_lookup_pixmap_converter ( fz_context * ctx , fz_colorspace * ds , fz_colorspace * ss ) {
if ( ds == NULL ) return fast_any_to_alpha ;
if ( ss == default_gray ) {
if ( ds == default_rgb ) return fast_gray_to_rgb ;
else if ( ds == default_bgr ) return fast_gray_to_rgb ;
else if ( ds == default_cmyk ) return fast_gray_to_cmyk ;
else return std_conv_pixmap ;
}
else if ( ss == default_rgb ) {
if ( ds == default_gray ) return fast_rgb_to_gray ;
else if ( ds == default_bgr ) return fast_rgb_to_bgr ;
else if ( ds == default_cmyk ) return fast_rgb_to_cmyk ;
else return std_conv_pixmap ;
}
else if ( ss == default_bgr ) {
if ( ds == default_gray ) return fast_bgr_to_gray ;
else if ( ds == default_rgb ) return fast_rgb_to_bgr ;
else if ( ds == default_cmyk ) return fast_bgr_to_cmyk ;
else return std_conv_pixmap ;
}
else if ( ss == default_cmyk ) {
if ( ds == default_gray ) return fast_cmyk_to_gray ;
else if ( ds == default_bgr ) return fast_cmyk_to_bgr ;
else if ( ds == default_rgb ) return fast_cmyk_to_rgb ;
else return std_conv_pixmap ;
}
else if ( ( ss == fz_device_rgb ( ctx ) && ds == fz_device_bgr ( ctx ) ) || ( ds == fz_device_rgb ( ctx ) && ss == fz_device_bgr ( ctx ) ) ) {
return fast_rgb_to_bgr ;
}
else {
const fz_colorspace * ss_base = fz_source_colorspace_cm ( ctx , ss ) ;
if ( ss_base != NULL && fz_colorspace_is_icc ( ctx , ds ) ) {
if ( ss_base == ss ) return icc_conv_pixmap ;
else return icc_base_conv_pixmap ;
}
else return std_conv_pixmap ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int send_certificate_request ( SSL * s ) {
if ( s -> verify_mode & SSL_VERIFY_PEER && ( ( s -> session -> peer == NULL ) || ! ( s -> verify_mode & SSL_VERIFY_CLIENT_ONCE ) ) && ( ! ( s -> s3 -> tmp . new_cipher -> algorithm_auth & SSL_aNULL ) || ( s -> verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT ) ) && ! ( s -> s3 -> tmp . new_cipher -> algorithm_auth & SSL_aSRP ) && ! ( s -> s3 -> tmp . new_cipher -> algorithm_auth & SSL_aPSK ) ) {
return 1 ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void add_objects_in_unpacked_packs ( struct rev_info * revs ) {
struct packed_git * p ;
struct in_pack in_pack ;
uint32_t i ;
memset ( & in_pack , 0 , sizeof ( in_pack ) ) ;
for ( p = packed_git ;
p ;
p = p -> next ) {
const unsigned char * sha1 ;
struct object * o ;
if ( ! p -> pack_local || p -> pack_keep ) continue ;
if ( open_pack_index ( p ) ) die ( "cannot open pack index" ) ;
ALLOC_GROW ( in_pack . array , in_pack . nr + p -> num_objects , in_pack . alloc ) ;
for ( i = 0 ;
i < p -> num_objects ;
i ++ ) {
sha1 = nth_packed_object_sha1 ( p , i ) ;
o = lookup_unknown_object ( sha1 ) ;
if ( ! ( o -> flags & OBJECT_ADDED ) ) mark_in_pack_object ( o , p , & in_pack ) ;
o -> flags |= OBJECT_ADDED ;
}
}
if ( in_pack . nr ) {
qsort ( in_pack . array , in_pack . nr , sizeof ( in_pack . array [ 0 ] ) , ofscmp ) ;
for ( i = 0 ;
i < in_pack . nr ;
i ++ ) {
struct object * o = in_pack . array [ i ] . object ;
add_object_entry ( o -> oid . hash , o -> type , "" , 0 ) ;
}
}
free ( in_pack . array ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int hfinfo_hex_digits ( const header_field_info * hfinfo ) {
int bitwidth ;
if ( hfinfo -> bitmask != 0 ) {
bitwidth = hfinfo_mask_bitwidth ( hfinfo ) ;
}
else {
bitwidth = hfinfo_type_bitwidth ( hfinfo -> type ) ;
}
return ( bitwidth + 3 ) / 4 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static zend_class_entry * row_get_ce ( const zval * object TSRMLS_DC ) {
return pdo_row_ce ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int SpoolssAddForm_q ( 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 ;
guint32 level ;
proto_item * hidden_item ;
hidden_item = proto_tree_add_uint ( tree , hf_form , tvb , offset , 0 , 1 ) ;
PROTO_ITEM_SET_HIDDEN ( hidden_item ) ;
offset = dissect_nt_policy_hnd ( tvb , offset , pinfo , tree , di , drep , hf_hnd , NULL , NULL , FALSE , FALSE ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , tree , di , drep , hf_form_level , & level ) ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , ", level %d" , level ) ;
if ( ! pinfo -> fd -> flags . visited ) {
dcv -> se_data = GUINT_TO_POINTER ( ( int ) level ) ;
}
offset = dissect_FORM_CTR ( tvb , offset , pinfo , tree , di , drep ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissct_rsl_ipaccess_msg ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , int offset ) {
guint8 msg_type ;
guint32 local_addr = 0 ;
guint16 local_port = 0 ;
address src_addr ;
msg_type = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
offset ++ ;
while ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) {
guint8 tag ;
unsigned int len , hlen ;
const struct tlv_def * tdef ;
proto_item * ti ;
proto_tree * ie_tree ;
tag = tvb_get_guint8 ( tvb , offset ) ;
tdef = & rsl_att_tlvdef . def [ tag ] ;
switch ( tdef -> type ) {
case TLV_TYPE_FIXED : hlen = 1 ;
len = tdef -> fixed_len ;
break ;
case TLV_TYPE_T : hlen = 1 ;
len = 0 ;
break ;
case TLV_TYPE_TV : hlen = 1 ;
len = 1 ;
break ;
case TLV_TYPE_TLV : hlen = 2 ;
len = tvb_get_guint8 ( tvb , offset + 1 ) ;
break ;
case TLV_TYPE_TL16V : hlen = 3 ;
len = tvb_get_guint8 ( tvb , offset + 1 ) << 8 | tvb_get_guint8 ( tvb , offset + 2 ) ;
break ;
case TLV_TYPE_UNKNOWN : default : DISSECTOR_ASSERT_NOT_REACHED ( ) ;
break ;
}
ti = proto_tree_add_item ( tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
ie_tree = proto_item_add_subtree ( ti , ett_ie_local_port ) ;
offset += hlen ;
switch ( tag ) {
case RSL_IE_CH_NO : dissect_rsl_ie_ch_no ( tvb , pinfo , ie_tree , offset , FALSE ) ;
break ;
case RSL_IE_FRAME_NO : dissect_rsl_ie_frame_no ( tvb , pinfo , ie_tree , offset , FALSE ) ;
break ;
case RSL_IE_MS_POW : dissect_rsl_ie_ms_pow ( tvb , pinfo , ie_tree , offset , FALSE ) ;
break ;
case RSL_IE_IPAC_REMOTE_IP : proto_tree_add_item ( ie_tree , hf_rsl_remote_ip , tvb , offset , len , ENC_BIG_ENDIAN ) ;
break ;
case RSL_IE_IPAC_REMOTE_PORT : proto_tree_add_item ( ie_tree , hf_rsl_remote_port , tvb , offset , len , ENC_BIG_ENDIAN ) ;
break ;
case RSL_IE_IPAC_LOCAL_IP : proto_tree_add_item ( ie_tree , hf_rsl_local_ip , tvb , offset , len , ENC_BIG_ENDIAN ) ;
local_addr = tvb_get_ipv4 ( tvb , offset ) ;
break ;
case RSL_IE_IPAC_LOCAL_PORT : proto_tree_add_item ( ie_tree , hf_rsl_local_port , tvb , offset , len , ENC_BIG_ENDIAN ) ;
local_port = tvb_get_ntohs ( tvb , offset ) ;
break ;
case RSL_IE_IPAC_SPEECH_MODE : proto_tree_add_item ( ie_tree , hf_rsl_speech_mode_s , tvb , offset , len , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_speech_mode_m , tvb , offset , len , ENC_BIG_ENDIAN ) ;
break ;
case RSL_IE_IPAC_RTP_PAYLOAD : case RSL_IE_IPAC_RTP_PAYLOAD2 : proto_tree_add_item ( ie_tree , hf_rsl_rtp_payload , tvb , offset , len , ENC_BIG_ENDIAN ) ;
break ;
case RSL_IE_IPAC_RTP_CSD_FMT : proto_tree_add_item ( ie_tree , hf_rsl_rtp_csd_fmt_d , tvb , offset , len , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_rtp_csd_fmt_ir , tvb , offset , len , ENC_BIG_ENDIAN ) ;
break ;
case RSL_IE_IPAC_CONN_ID : proto_tree_add_item ( ie_tree , hf_rsl_conn_id , tvb , offset , len , ENC_BIG_ENDIAN ) ;
break ;
case RSL_IE_IPAC_CONN_STAT : proto_tree_add_item ( ie_tree , hf_rsl_cstat_tx_pkts , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_cstat_tx_octs , tvb , offset + 4 , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_cstat_rx_pkts , tvb , offset + 8 , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_cstat_rx_octs , tvb , offset + 12 , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_cstat_lost_pkts , tvb , offset + 16 , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_cstat_ia_jitter , tvb , offset + 20 , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_cstat_avg_tx_dly , tvb , offset + 24 , 4 , ENC_BIG_ENDIAN ) ;
break ;
}
offset += len ;
}
switch ( msg_type ) {
case RSL_MSG_TYPE_IPAC_CRCX_ACK : src_addr . type = AT_IPv4 ;
src_addr . len = 4 ;
src_addr . data = ( guint8 * ) & local_addr ;
rtp_add_address ( pinfo , & src_addr , local_port , 0 , "GSM A-bis/IP" , pinfo -> fd -> num , 0 , NULL ) ;
rtcp_add_address ( pinfo , & src_addr , local_port + 1 , 0 , "GSM A-bis/IP" , pinfo -> fd -> num ) ;
break ;
}
return offset ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int decode_residues ( TAKDecContext * s , int32_t * decoded , int length ) {
GetBitContext * gb = & s -> gb ;
int i , mode , ret ;
if ( length > s -> nb_samples ) return AVERROR_INVALIDDATA ;
if ( get_bits1 ( gb ) ) {
int wlength , rval ;
int coding_mode [ 128 ] ;
wlength = length / s -> uval ;
rval = length - ( wlength * s -> uval ) ;
if ( rval < s -> uval / 2 ) rval += s -> uval ;
else wlength ++ ;
if ( wlength <= 1 || wlength > 128 ) return AVERROR_INVALIDDATA ;
coding_mode [ 0 ] = mode = get_bits ( gb , 6 ) ;
for ( i = 1 ;
i < wlength ;
i ++ ) {
int c = get_unary ( gb , 1 , 6 ) ;
switch ( c ) {
case 6 : mode = get_bits ( gb , 6 ) ;
break ;
case 5 : case 4 : case 3 : {
int sign = get_bits1 ( gb ) ;
mode += ( - sign ^ ( c - 1 ) ) + sign ;
break ;
}
case 2 : mode ++ ;
break ;
case 1 : mode -- ;
break ;
}
coding_mode [ i ] = mode ;
}
i = 0 ;
while ( i < wlength ) {
int len = 0 ;
mode = coding_mode [ i ] ;
do {
if ( i >= wlength - 1 ) len += rval ;
else len += s -> uval ;
i ++ ;
if ( i == wlength ) break ;
}
while ( coding_mode [ i ] == mode ) ;
if ( ( ret = decode_segment ( gb , mode , decoded , len ) ) < 0 ) return ret ;
decoded += len ;
}
}
else {
mode = get_bits ( gb , 6 ) ;
if ( ( ret = decode_segment ( gb , mode , decoded , length ) ) < 0 ) return ret ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static guint16 de_cause ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len , gchar * add_string , int string_len ) {
guint8 oct ;
guint8 cause ;
guint32 curr_offset ;
guint32 diag_length ;
proto_tree * subtree ;
const gchar * str ;
curr_offset = offset ;
proto_tree_add_item ( tree , hf_gsm_a_extension , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_de_cause_coding_standard , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_bits_item ( tree , hf_gsm_a_spare_bits , tvb , ( curr_offset << 3 ) + 3 , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_location , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
curr_offset ++ ;
oct = tvb_get_guint8 ( tvb , curr_offset ) ;
if ( ! ( oct & 0x80 ) ) {
proto_tree_add_item ( tree , hf_gsm_a_extension , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_recommendation , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
curr_offset ++ ;
oct = tvb_get_guint8 ( tvb , curr_offset ) ;
}
proto_tree_add_item ( tree , hf_gsm_a_extension , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
cause = oct & 0x7f ;
switch ( cause ) {
case 1 : str = "Unassigned (unallocated) number" ;
break ;
case 3 : str = "No route to destination" ;
break ;
case 6 : str = "Channel unacceptable" ;
break ;
case 8 : str = "Operator determined barring" ;
break ;
case 16 : str = "Normal call clearing" ;
break ;
case 17 : str = "User busy" ;
break ;
case 18 : str = "No user responding" ;
break ;
case 19 : str = "User alerting, no answer" ;
break ;
case 21 : str = "Call rejected" ;
break ;
case 22 : str = "Call rejected due to feature at the destination" ;
break ;
case 24 : str = "Number changed" ;
break ;
case 25 : str = "Pre-emption" ;
break ;
case 26 : str = "Non selected user clearing" ;
break ;
case 27 : str = "Destination out of order" ;
break ;
case 28 : str = "Invalid number format (incomplete number)" ;
break ;
case 29 : str = "Facility rejected" ;
break ;
case 30 : str = "Response to STATUS ENQUIRY" ;
break ;
case 31 : str = "Normal, unspecified" ;
break ;
case 34 : str = "No circuit/channel available" ;
break ;
case 38 : str = "Network out of order" ;
break ;
case 41 : str = "Temporary failure" ;
break ;
case 42 : str = "Switching equipment congestion" ;
break ;
case 43 : str = "Access information discarded" ;
break ;
case 44 : str = "requested circuit/channel not available" ;
break ;
case 47 : str = "Resources unavailable, unspecified" ;
break ;
case 49 : str = "Quality of service unavailable" ;
break ;
case 50 : str = "Requested facility not subscribed" ;
break ;
case 55 : str = "Incoming calls barred within the CUG" ;
break ;
case 57 : str = "Bearer capability not authorized" ;
break ;
case 58 : str = "Bearer capability not presently available" ;
break ;
case 63 : str = "Service or option not available, unspecified" ;
break ;
case 65 : str = "Bearer service not implemented" ;
break ;
case 68 : str = "ACM equal to or greater than ACMmax" ;
break ;
case 69 : str = "Requested facility not implemented" ;
break ;
case 70 : str = "Only restricted digital information bearer capability is available" ;
break ;
case 79 : str = "Service or option not implemented, unspecified" ;
break ;
case 81 : str = "Invalid transaction identifier value" ;
break ;
case 87 : str = "User not member of CUG" ;
break ;
case 88 : str = "Incompatible destination" ;
break ;
case 91 : str = "Invalid transit network selection" ;
break ;
case 95 : str = "Semantically incorrect message" ;
break ;
case 96 : str = "Invalid mandatory information" ;
break ;
case 97 : str = "Message type non-existent or not implemented" ;
break ;
case 98 : str = "Message type not compatible with protocol state" ;
break ;
case 99 : str = "Information element non-existent or not implemented" ;
break ;
case 100 : str = "Conditional IE error" ;
break ;
case 101 : str = "Message not compatible with protocol state" ;
break ;
case 102 : str = "Recovery on timer expiry" ;
break ;
case 111 : str = "Protocol error, unspecified" ;
break ;
case 127 : str = "Interworking, unspecified" ;
break ;
default : if ( cause <= 31 ) {
str = "Treat as Normal, unspecified" ;
}
else if ( ( cause >= 32 ) && ( cause <= 47 ) ) {
str = "Treat as Resources unavailable, unspecified" ;
}
else if ( ( cause >= 48 ) && ( cause <= 63 ) ) {
str = "Treat as Service or option not available, unspecified" ;
}
else if ( ( cause >= 64 ) && ( cause <= 79 ) ) {
str = "Treat as Service or option not implemented, unspecified" ;
}
else if ( ( cause >= 80 ) && ( cause <= 95 ) ) {
str = "Treat as Semantically incorrect message" ;
}
else if ( ( cause >= 96 ) && ( cause <= 111 ) ) {
str = "Treat as Protocol error, unspecified" ;
}
else {
str = "Treat as Interworking, unspecified" ;
}
break ;
}
proto_tree_add_uint_format_value ( tree , hf_gsm_a_dtap_cause , tvb , curr_offset , 1 , cause , "Cause: (%u) %s" , cause , str ) ;
curr_offset ++ ;
if ( add_string ) g_snprintf ( add_string , string_len , " - (%u) %s" , cause , str ) ;
NO_MORE_DATA_CHECK ( len ) ;
subtree = proto_tree_add_subtree ( tree , tvb , curr_offset , len - ( curr_offset - offset ) , ett_gsm_dtap_elem [ DE_CAUSE ] , NULL , "Diagnostics" ) ;
if ( ( cause == 17 ) || ( cause == 29 ) || ( cause == 34 ) || ( cause == 50 ) || ( cause == 55 ) || ( cause == 69 ) || ( cause == 87 ) ) {
proto_tree_add_item ( subtree , hf_gsm_a_extension , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( subtree , hf_gsm_a_dtap_cause_ss_diagnostics , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
curr_offset ++ ;
}
else {
diag_length = len - ( curr_offset - offset ) ;
proto_tree_add_item ( subtree , hf_gsm_a_dtap_data , tvb , curr_offset , diag_length , ENC_NA ) ;
curr_offset += diag_length ;
}
EXTRANEOUS_DATA_CHECK ( len , curr_offset - offset , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
return ( curr_offset - offset ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
guint16 elem_lv ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo , gint pdu_type , int idx , guint32 offset , guint len _U_ , const gchar * name_add ) {
guint8 parm_len ;
guint16 consumed ;
guint32 curr_offset ;
proto_tree * subtree ;
proto_item * item ;
value_string_ext elem_names_ext ;
gint * elem_ett ;
const gchar * elem_name ;
guint16 ( * * elem_funcs ) ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo , guint32 offset , guint len , gchar * add_string , int string_len ) ;
curr_offset = offset ;
consumed = 0 ;
SET_ELEM_VARS ( pdu_type , elem_names_ext , elem_ett , elem_funcs , & ei_gsm_a_unknown_pdu_type ) ;
parm_len = tvb_get_guint8 ( tvb , curr_offset ) ;
elem_name = try_val_to_str_ext ( idx , & elem_names_ext ) ;
if ( elem_name == NULL ) {
proto_tree_add_expert_format ( tree , pinfo , & ei_gsm_a_unknown_element , tvb , curr_offset , parm_len + 1 , "Unknown - aborting dissection%s" , ( name_add == NULL ) || ( name_add [ 0 ] == '\0' ) ? "" : name_add ) ;
return consumed ;
}
subtree = proto_tree_add_subtree_format ( tree , tvb , curr_offset , parm_len + 1 , elem_ett [ idx ] , & item , "%s%s" , elem_name , ( name_add == NULL ) || ( name_add [ 0 ] == '\0' ) ? "" : name_add ) ;
proto_tree_add_uint ( subtree , hf_gsm_a_length , tvb , curr_offset , 1 , parm_len ) ;
if ( parm_len > 0 ) {
if ( elem_funcs [ idx ] == NULL ) {
proto_tree_add_item ( subtree , hf_gsm_a_element_value , tvb , curr_offset + 1 , parm_len , ENC_NA ) ;
consumed = parm_len ;
}
else {
gchar * a_add_string ;
a_add_string = ( gchar * ) wmem_alloc ( wmem_packet_scope ( ) , 1024 ) ;
a_add_string [ 0 ] = '\0' ;
consumed = ( * elem_funcs [ idx ] ) ( tvb , subtree , pinfo , curr_offset + 1 , parm_len , a_add_string , 1024 ) ;
if ( a_add_string [ 0 ] != '\0' ) {
proto_item_append_text ( item , "%s" , a_add_string ) ;
}
}
}
return ( consumed + 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_set_rd_speed_thresholds_sub8x8 ( VP9_COMP * cpi ) {
const SPEED_FEATURES * const sf = & cpi -> sf ;
RD_OPT * const rd = & cpi -> rd ;
int i ;
for ( i = 0 ;
i < MAX_REFS ;
++ i ) rd -> thresh_mult_sub8x8 [ i ] = cpi -> oxcf . mode == BEST ? - 500 : 0 ;
rd -> thresh_mult_sub8x8 [ THR_LAST ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_GOLD ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_ALTR ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_INTRA ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_COMP_LA ] += 4500 ;
rd -> thresh_mult_sub8x8 [ THR_COMP_GA ] += 4500 ;
for ( i = 0 ;
i < MAX_REFS ;
++ i ) if ( sf -> disable_split_mask & ( 1 << i ) ) rd -> thresh_mult_sub8x8 [ i ] = INT_MAX ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( ExtensionPreferenceApiTest , MAYBE_Standard ) {
PrefService * prefs = profile_ -> GetPrefs ( ) ;
prefs -> SetBoolean ( prefs : : kAlternateErrorPagesEnabled , false ) ;
prefs -> SetBoolean ( autofill : : prefs : : kAutofillEnabledDeprecated , false ) ;
prefs -> SetBoolean ( autofill : : prefs : : kAutofillCreditCardEnabled , false ) ;
prefs -> SetBoolean ( autofill : : prefs : : kAutofillProfileEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kBlockThirdPartyCookies , true ) ;
prefs -> SetBoolean ( prefs : : kEnableHyperlinkAuditing , false ) ;
prefs -> SetBoolean ( prefs : : kEnableReferrers , false ) ;
prefs -> SetBoolean ( prefs : : kOfferTranslateEnabled , false ) ;
prefs -> SetInteger ( prefs : : kNetworkPredictionOptions , chrome_browser_net : : NETWORK_PREDICTION_NEVER ) ;
prefs -> SetBoolean ( password_manager : : prefs : : kCredentialsEnableService , false ) ;
prefs -> SetBoolean ( prefs : : kSafeBrowsingEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kSearchSuggestEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kWebRTCMultipleRoutesEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kWebRTCNonProxiedUdpEnabled , false ) ;
prefs -> SetString ( prefs : : kWebRTCIPHandlingPolicy , content : : kWebRTCIPHandlingDefaultPublicInterfaceOnly ) ;
const char kExtensionPath [ ] = "preference/standard" ;
EXPECT_TRUE ( RunExtensionSubtest ( kExtensionPath , "test.html" ) ) << message_ ;
CheckPreferencesSet ( ) ;
ReloadExtension ( last_loaded_extension_id ( ) ) ;
CheckPreferencesSet ( ) ;
extensions : : TestExtensionRegistryObserver observer ( extensions : : ExtensionRegistry : : Get ( profile_ ) , last_loaded_extension_id ( ) ) ;
UninstallExtension ( last_loaded_extension_id ( ) ) ;
observer . WaitForExtensionUninstalled ( ) ;
CheckPreferencesCleared ( ) ;
LoadExtension ( test_data_dir_ . AppendASCII ( kExtensionPath ) ) ;
CheckPreferencesCleared ( ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void cirrus_cursor_draw_line ( VGACommonState * s1 , uint8_t * d1 , int scr_y ) {
CirrusVGAState * s = container_of ( s1 , CirrusVGAState , vga ) ;
int w , h , x1 , x2 , poffset ;
unsigned int color0 , color1 ;
const uint8_t * palette , * src ;
uint32_t content ;
if ( ! ( s -> vga . sr [ 0x12 ] & CIRRUS_CURSOR_SHOW ) ) return ;
if ( s -> vga . sr [ 0x12 ] & CIRRUS_CURSOR_LARGE ) {
h = 64 ;
}
else {
h = 32 ;
}
if ( scr_y < s -> vga . hw_cursor_y || scr_y >= ( s -> vga . hw_cursor_y + h ) ) {
return ;
}
src = s -> vga . vram_ptr + s -> real_vram_size - 16 * 1024 ;
if ( s -> vga . sr [ 0x12 ] & CIRRUS_CURSOR_LARGE ) {
src += ( s -> vga . sr [ 0x13 ] & 0x3c ) * 256 ;
src += ( scr_y - s -> vga . hw_cursor_y ) * 16 ;
poffset = 8 ;
content = ( ( uint32_t * ) src ) [ 0 ] | ( ( uint32_t * ) src ) [ 1 ] | ( ( uint32_t * ) src ) [ 2 ] | ( ( uint32_t * ) src ) [ 3 ] ;
}
else {
src += ( s -> vga . sr [ 0x13 ] & 0x3f ) * 256 ;
src += ( scr_y - s -> vga . hw_cursor_y ) * 4 ;
poffset = 128 ;
content = ( ( uint32_t * ) src ) [ 0 ] | ( ( uint32_t * ) ( src + 128 ) ) [ 0 ] ;
}
if ( ! content ) return ;
w = h ;
x1 = s -> vga . hw_cursor_x ;
if ( x1 >= s -> vga . last_scr_width ) return ;
x2 = s -> vga . hw_cursor_x + w ;
if ( x2 > s -> vga . last_scr_width ) x2 = s -> vga . last_scr_width ;
w = x2 - x1 ;
palette = s -> cirrus_hidden_palette ;
color0 = rgb_to_pixel32 ( c6_to_8 ( palette [ 0x0 * 3 ] ) , c6_to_8 ( palette [ 0x0 * 3 + 1 ] ) , c6_to_8 ( palette [ 0x0 * 3 + 2 ] ) ) ;
color1 = rgb_to_pixel32 ( c6_to_8 ( palette [ 0xf * 3 ] ) , c6_to_8 ( palette [ 0xf * 3 + 1 ] ) , c6_to_8 ( palette [ 0xf * 3 + 2 ] ) ) ;
d1 += x1 * 4 ;
vga_draw_cursor_line ( d1 , src , poffset , w , color0 , color1 , 0xffffff ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int kvm_put_xsave ( X86CPU * cpu ) {
CPUX86State * env = & cpu -> env ;
X86XSaveArea * xsave = env -> kvm_xsave_buf ;
if ( ! has_xsave ) {
return kvm_put_fpu ( cpu ) ;
}
x86_cpu_xsave_all_areas ( cpu , xsave ) ;
return kvm_vcpu_ioctl ( CPU ( cpu ) , KVM_SET_XSAVE , xsave ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int mainwindows_compare_reverse ( MAIN_WINDOW_REC * w1 , MAIN_WINDOW_REC * w2 ) {
return w1 -> first_line < w2 -> first_line ? 1 : w1 -> first_line > w2 -> first_line ? - 1 : w1 -> first_column < w2 -> first_column ? 1 : w1 -> first_column > w2 -> first_column ? - 1 : 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static bool mcg_ext_ctl_needed ( void * opaque ) {
X86CPU * cpu = opaque ;
CPUX86State * env = & cpu -> env ;
return cpu -> enable_lmce && env -> mcg_ext_ctl ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void set_once_property ( enum_prop prop , my_bool val ) {
property & pr = prop_list [ prop ] ;
pr . set = 1 ;
pr . old = * pr . var ;
* pr . var = val ;
var_set_int ( pr . env_name , ( val != pr . reverse ) ) ;
once_property = TRUE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void rfbProcessClientInitMessage ( rfbClientPtr cl ) {
rfbClientInitMsg ci ;
union {
char buf [ 256 ] ;
rfbServerInitMsg si ;
}
u ;
int len , n ;
rfbClientIteratorPtr iterator ;
rfbClientPtr otherCl ;
rfbExtensionData * extension ;
if ( cl -> state == RFB_INITIALISATION_SHARED ) {
ci . shared = 1 ;
cl -> state = RFB_INITIALISATION ;
}
else {
if ( ( n = rfbReadExact ( cl , ( char * ) & ci , sz_rfbClientInitMsg ) ) <= 0 ) {
if ( n == 0 ) rfbLog ( "rfbProcessClientInitMessage: client gone\n" ) ;
else rfbLogPerror ( "rfbProcessClientInitMessage: read" ) ;
rfbCloseClient ( cl ) ;
return ;
}
}
memset ( u . buf , 0 , sizeof ( u . buf ) ) ;
u . si . framebufferWidth = Swap16IfLE ( cl -> screen -> width ) ;
u . si . framebufferHeight = Swap16IfLE ( cl -> screen -> height ) ;
u . si . format = cl -> screen -> serverFormat ;
u . si . format . redMax = Swap16IfLE ( u . si . format . redMax ) ;
u . si . format . greenMax = Swap16IfLE ( u . si . format . greenMax ) ;
u . si . format . blueMax = Swap16IfLE ( u . si . format . blueMax ) ;
strncpy ( u . buf + sz_rfbServerInitMsg , cl -> screen -> desktopName , 127 ) ;
len = strlen ( u . buf + sz_rfbServerInitMsg ) ;
u . si . nameLength = Swap32IfLE ( len ) ;
if ( rfbWriteExact ( cl , u . buf , sz_rfbServerInitMsg + len ) < 0 ) {
rfbLogPerror ( "rfbProcessClientInitMessage: write" ) ;
rfbCloseClient ( cl ) ;
return ;
}
for ( extension = cl -> extensions ;
extension ;
) {
rfbExtensionData * next = extension -> next ;
if ( extension -> extension -> init && ! extension -> extension -> init ( cl , extension -> data ) ) rfbDisableExtension ( cl , extension -> extension ) ;
extension = next ;
}
cl -> state = RFB_NORMAL ;
if ( ! cl -> reverseConnection && ( cl -> screen -> neverShared || ( ! cl -> screen -> alwaysShared && ! ci . shared ) ) ) {
if ( cl -> screen -> dontDisconnect ) {
iterator = rfbGetClientIterator ( cl -> screen ) ;
while ( ( otherCl = rfbClientIteratorNext ( iterator ) ) != NULL ) {
if ( ( otherCl != cl ) && ( otherCl -> state == RFB_NORMAL ) ) {
rfbLog ( "-dontdisconnect: Not shared & existing client\n" ) ;
rfbLog ( " refusing new client %s\n" , cl -> host ) ;
rfbCloseClient ( cl ) ;
rfbReleaseClientIterator ( iterator ) ;
return ;
}
}
rfbReleaseClientIterator ( iterator ) ;
}
else {
iterator = rfbGetClientIterator ( cl -> screen ) ;
while ( ( otherCl = rfbClientIteratorNext ( iterator ) ) != NULL ) {
if ( ( otherCl != cl ) && ( otherCl -> state == RFB_NORMAL ) ) {
rfbLog ( "Not shared - closing connection to client %s\n" , otherCl -> host ) ;
rfbCloseClient ( otherCl ) ;
}
}
rfbReleaseClientIterator ( iterator ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_H235Mode ( 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_H235Mode , H235Mode_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_ber ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ ) {
const char * name ;
int offset ;
col_set_str ( pinfo -> cinfo , COL_PROTOCOL , "BER" ) ;
col_set_str ( pinfo -> cinfo , COL_DEF_SRC , "BER encoded file" ) ;
if ( ! decode_as_syntax ) {
col_set_str ( pinfo -> cinfo , COL_INFO , "Unknown BER" ) ;
offset = dissect_unknown_ber ( pinfo , tvb , 0 , tree ) ;
}
else {
offset = call_ber_syntax_callback ( decode_as_syntax , tvb , 0 , pinfo , tree ) ;
name = get_ber_oid_syntax ( decode_as_syntax ) ;
col_add_fstr ( pinfo -> cinfo , COL_INFO , "Decoded as %s" , name ? name : decode_as_syntax ) ;
}
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void restore_query_logs ( ) {
int rc ;
rc = mysql_query ( mysql , "set @@global.general_log=@save_global_general_log" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "set @@global.slow_query_log=@save_global_slow_query_log" ) ;
myquery ( rc ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int pfkey_acquire ( struct sock * sk , struct sk_buff * skb , const struct sadb_msg * hdr , void * const * ext_hdrs ) {
struct net * net = sock_net ( sk ) ;
struct xfrm_state * x ;
if ( hdr -> sadb_msg_len != sizeof ( struct sadb_msg ) / 8 ) return - EOPNOTSUPP ;
if ( hdr -> sadb_msg_seq == 0 || hdr -> sadb_msg_errno == 0 ) return 0 ;
x = xfrm_find_acq_byseq ( net , DUMMY_MARK , hdr -> sadb_msg_seq ) ;
if ( x == NULL ) return 0 ;
spin_lock_bh ( & x -> lock ) ;
if ( x -> km . state == XFRM_STATE_ACQ ) {
x -> km . state = XFRM_STATE_ERROR ;
wake_up ( & net -> xfrm . km_waitq ) ;
}
spin_unlock_bh ( & x -> lock ) ;
xfrm_state_put ( x ) ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int parse_paged_cookie ( Operation * op , SlapReply * rs ) {
int rc = LDAP_SUCCESS ;
PagedResultsState * ps = op -> o_pagedresults_state ;
assert ( get_pagedresults ( op ) > SLAP_CONTROL_IGNORED ) ;
if ( ps -> ps_cookieval . bv_len ) {
PagedResultsCookie reqcookie ;
if ( ps -> ps_cookieval . bv_len != sizeof ( reqcookie ) ) {
rs -> sr_text = "paged results cookie is invalid" ;
rc = LDAP_PROTOCOL_ERROR ;
goto done ;
}
AC_MEMCPY ( & reqcookie , ps -> ps_cookieval . bv_val , sizeof ( reqcookie ) ) ;
if ( reqcookie > ps -> ps_cookie ) {
rs -> sr_text = "paged results cookie is invalid" ;
rc = LDAP_PROTOCOL_ERROR ;
goto done ;
}
else if ( reqcookie < ps -> ps_cookie ) {
rs -> sr_text = "paged results cookie is invalid or old" ;
rc = LDAP_UNWILLING_TO_PERFORM ;
goto done ;
}
}
else {
op -> o_conn -> c_pagedresults_state . ps_cookie = 0 ;
}
done : ;
return rc ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_T_enhanced ( 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_enhanced , T_enhanced_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static __inline__ __u64 ethtool_get_flow_spec_ring ( __u64 ring_cookie ) {
return ETHTOOL_RX_FLOW_SPEC_RING & ring_cookie ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static BLOCK_SIZE find_partition_size ( BLOCK_SIZE bsize , int rows_left , int cols_left , int * bh , int * bw ) {
if ( rows_left <= 0 || cols_left <= 0 ) {
return MIN ( bsize , BLOCK_8X8 ) ;
}
else {
for ( ;
bsize > 0 ;
bsize -= 3 ) {
* bh = num_8x8_blocks_high_lookup [ bsize ] ;
* bw = num_8x8_blocks_wide_lookup [ bsize ] ;
if ( ( * bh <= rows_left ) && ( * bw <= cols_left ) ) {
break ;
}
}
}
return bsize ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TSVConn TSHttpConnect ( sockaddr const * addr ) {
return TSHttpConnectWithPluginId ( addr , "plugin" , 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static OFCondition parseDummy ( unsigned char * buf , unsigned long * itemLength , unsigned long availData ) {
unsigned short userLength ;
if ( availData < 4 ) return makeLengthError ( "dummy item" , availData , 4 ) ;
buf ++ ;
buf ++ ;
EXTRACT_SHORT_BIG ( buf , userLength ) ;
buf += 2 ;
if ( availData - 4 < userLength ) return makeLengthError ( "dummy item" , availData , 0 , userLength ) ;
* itemLength = userLength + 4 ;
return EC_Normal ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int err_end_runandhide ( i_ctx_t * i_ctx_p ) {
int code ;
if ( ( code = runandhide_restore_hidden ( i_ctx_p , esp + 3 , esp + 2 ) ) < 0 ) return code ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int check_key_name ( const char * name , const Py_ssize_t name_length ) {
int i ;
if ( name_length > 0 && name [ 0 ] == '$' ) {
PyObject * InvalidDocument = _error ( "InvalidDocument" ) ;
# if PY_MAJOR_VERSION >= 3 PyObject * errmsg = PyUnicode_FromFormat ( "key '%s' must not start with '$'" , name ) ;
PyErr_SetObject ( InvalidDocument , errmsg ) ;
# else PyObject * errmsg = PyString_FromFormat ( "key '%s' must not start with '$'" , name ) ;
PyErr_SetString ( InvalidDocument , PyString_AsString ( errmsg ) ) ;
# endif Py_DECREF ( errmsg ) ;
Py_DECREF ( InvalidDocument ) ;
return 0 ;
}
for ( i = 0 ;
i < name_length ;
i ++ ) {
if ( name [ i ] == '.' ) {
PyObject * InvalidDocument = _error ( "InvalidDocument" ) ;
# if PY_MAJOR_VERSION >= 3 PyObject * errmsg = PyUnicode_FromFormat ( "key '%s' must not contain '.'" , name ) ;
PyErr_SetObject ( InvalidDocument , errmsg ) ;
# else PyObject * errmsg = PyString_FromFormat ( "key '%s' must not contain '.'" , name ) ;
PyErr_SetString ( InvalidDocument , PyString_AsString ( errmsg ) ) ;
# endif Py_DECREF ( errmsg ) ;
Py_DECREF ( InvalidDocument ) ;
return 0 ;
}
}
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int x ( struct vcache * avc , int afun , struct vrequest * areq , \ struct afs_pdata * ain , struct afs_pdata * aout , \ afs_ucred_t * * acred ) DECL_PIOCTL ( PGetFID ) ;
DECL_PIOCTL ( PSetAcl ) ;
DECL_PIOCTL ( PStoreBehind ) ;
DECL_PIOCTL ( PGCPAGs ) ;
DECL_PIOCTL ( PGetAcl ) ;
DECL_PIOCTL ( PNoop ) ;
DECL_PIOCTL ( PBogus ) ;
DECL_PIOCTL ( PGetFileCell ) ;
DECL_PIOCTL ( PGetWSCell ) ;
DECL_PIOCTL ( PGetUserCell ) ;
DECL_PIOCTL ( PSetTokens ) ;
DECL_PIOCTL ( PGetVolumeStatus ) ;
DECL_PIOCTL ( PSetVolumeStatus ) ;
DECL_PIOCTL ( PFlush ) ;
DECL_PIOCTL ( PNewStatMount ) ;
DECL_PIOCTL ( PGetTokens ) ;
DECL_PIOCTL ( PUnlog ) ;
DECL_PIOCTL ( PMariner ) ;
DECL_PIOCTL ( PCheckServers ) ;
DECL_PIOCTL ( PCheckVolNames ) ;
DECL_PIOCTL ( PCheckAuth ) ;
DECL_PIOCTL ( PFindVolume ) ;
DECL_PIOCTL ( PViceAccess ) ;
DECL_PIOCTL ( PSetCacheSize ) ;
DECL_PIOCTL ( PGetCacheSize ) ;
DECL_PIOCTL ( PRemoveCallBack ) ;
DECL_PIOCTL ( PNewCell ) ;
DECL_PIOCTL ( PNewAlias ) ;
DECL_PIOCTL ( PListCells ) ;
DECL_PIOCTL ( PListAliases ) ;
DECL_PIOCTL ( PRemoveMount ) ;
DECL_PIOCTL ( PGetCellStatus ) ;
DECL_PIOCTL ( PSetCellStatus ) ;
DECL_PIOCTL ( PFlushVolumeData ) ;
DECL_PIOCTL ( PFlushAllVolumeData ) ;
DECL_PIOCTL ( PGetVnodeXStatus ) ;
DECL_PIOCTL ( PGetVnodeXStatus2 ) ;
DECL_PIOCTL ( PSetSysName ) ;
DECL_PIOCTL ( PSetSPrefs ) ;
DECL_PIOCTL ( PSetSPrefs33 )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
fz_colorspace * fz_device_rgb ( fz_context * ctx ) {
return ctx -> colorspace -> rgb ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void count_file ( GFileInfo * info , CommonJob * job , SourceInfo * source_info ) {
source_info -> num_files += 1 ;
source_info -> num_bytes += g_file_info_get_size ( info ) ;
if ( source_info -> num_files_since_progress ++ > 100 ) {
report_preparing_count_progress ( job , source_info ) ;
source_info -> num_files_since_progress = 0 ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dtap_tp_close_tch_loop_cmd ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) {
guint32 curr_offset ;
guint32 consumed ;
guint curr_len ;
curr_len = len ;
curr_offset = offset ;
ELEM_MAND_V ( GSM_A_PDU_TYPE_DTAP , DE_TP_SUB_CHANNEL , NULL ) ;
EXTRANEOUS_DATA_CHECK ( curr_len , 0 , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( UnloadTest , BrowserCloseTabWhenOtherTabHasListener ) {
NavigateToDataURL ( CLOSE_TAB_WHEN_OTHER_TAB_HAS_LISTENER , "only_one_unload" ) ;
content : : WindowedNotificationObserver observer ( chrome : : NOTIFICATION_TAB_ADDED , content : : NotificationService : : AllSources ( ) ) ;
content : : WindowedNotificationObserver load_stop_observer ( content : : NOTIFICATION_LOAD_STOP , content : : NotificationService : : AllSources ( ) ) ;
content : : SimulateMouseClick ( browser ( ) -> tab_strip_model ( ) -> GetActiveWebContents ( ) , 0 , blink : : WebMouseEvent : : Button : : Left ) ;
observer . Wait ( ) ;
load_stop_observer . Wait ( ) ;
CheckTitle ( "popup" ) ;
content : : WebContentsDestroyedWatcher destroyed_watcher ( browser ( ) -> tab_strip_model ( ) -> GetActiveWebContents ( ) ) ;
chrome : : CloseTab ( browser ( ) ) ;
destroyed_watcher . Wait ( ) ;
CheckTitle ( "only_one_unload" ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gboolean read_blob ( FILE_T infile , ngsniffer_comp_stream_t * comp_stream , int * err , gchar * * err_info ) {
int in_len ;
unsigned short blob_len ;
gint16 blob_len_host ;
gboolean uncompressed ;
unsigned char * file_inbuf ;
int out_len ;
if ( ! wtap_read_bytes_or_eof ( infile , & blob_len , 2 , err , err_info ) ) return FALSE ;
comp_stream -> comp_offset += 2 ;
blob_len_host = pletoh16 ( & blob_len ) ;
if ( blob_len_host < 0 ) {
in_len = - blob_len_host ;
uncompressed = TRUE ;
}
else {
in_len = blob_len_host ;
uncompressed = FALSE ;
}
file_inbuf = ( unsigned char * ) g_malloc ( INBUF_SIZE ) ;
if ( ! wtap_read_bytes ( infile , file_inbuf , in_len , err , err_info ) ) {
g_free ( file_inbuf ) ;
return FALSE ;
}
comp_stream -> comp_offset += in_len ;
if ( uncompressed ) {
memcpy ( comp_stream -> buf , file_inbuf , in_len ) ;
out_len = in_len ;
}
else {
out_len = SnifferDecompress ( file_inbuf , in_len , comp_stream -> buf , OUTBUF_SIZE , err , err_info ) ;
if ( out_len < 0 ) {
g_free ( file_inbuf ) ;
return FALSE ;
}
}
g_free ( file_inbuf ) ;
comp_stream -> nextout = 0 ;
comp_stream -> nbytes = out_len ;
return TRUE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void decode_power_conf_frequency ( gchar * s , guint32 value ) {
if ( value == 0x00 ) g_snprintf ( s , ITEM_LABEL_LENGTH , "Frequency too low to be measured (or DC supply)" ) ;
else if ( value == 0xfe ) g_snprintf ( s , ITEM_LABEL_LENGTH , "Frequency too high to be measured" ) ;
else if ( value == 0xff ) g_snprintf ( s , ITEM_LABEL_LENGTH , "Frequency could not be measured" ) ;
else g_snprintf ( s , ITEM_LABEL_LENGTH , "%d [Hz]" , value * 2 ) ;
return ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void write_branch_report ( FILE * rpt , struct branch * b ) {
fprintf ( rpt , "%s:\n" , b -> name ) ;
fprintf ( rpt , " status :" ) ;
if ( b -> active ) fputs ( " active" , rpt ) ;
if ( b -> branch_tree . tree ) fputs ( " loaded" , rpt ) ;
if ( is_null_sha1 ( b -> branch_tree . versions [ 1 ] . sha1 ) ) fputs ( " dirty" , rpt ) ;
fputc ( '\n' , rpt ) ;
fprintf ( rpt , " tip commit : %s\n" , sha1_to_hex ( b -> sha1 ) ) ;
fprintf ( rpt , " old tree : %s\n" , sha1_to_hex ( b -> branch_tree . versions [ 0 ] . sha1 ) ) ;
fprintf ( rpt , " cur tree : %s\n" , sha1_to_hex ( b -> branch_tree . versions [ 1 ] . sha1 ) ) ;
fprintf ( rpt , " commit clock: %" PRIuMAX "\n" , b -> last_commit ) ;
fputs ( " last pack : " , rpt ) ;
if ( b -> pack_id < MAX_PACK_ID ) fprintf ( rpt , "%u" , b -> pack_id ) ;
fputc ( '\n' , rpt ) ;
fputc ( '\n' , rpt ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h225_InfoRequestNak ( 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_InfoRequestNak , InfoRequestNak_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
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 ( ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
PREDICTION_MODE vp9_above_block_mode ( const MODE_INFO * cur_mi , const MODE_INFO * above_mi , int b ) {
if ( b == 0 || b == 1 ) {
if ( ! above_mi || is_inter_block ( & above_mi -> mbmi ) ) return DC_PRED ;
return get_y_mode ( above_mi , b + 2 ) ;
}
else {
assert ( b == 2 || b == 3 ) ;
return cur_mi -> bmi [ b - 2 ] . as_mode ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void configure_buffer_updates ( VP9_COMP * cpi ) {
TWO_PASS * const twopass = & cpi -> twopass ;
cpi -> rc . is_src_frame_alt_ref = 0 ;
switch ( twopass -> gf_group . update_type [ twopass -> gf_group . index ] ) {
case KF_UPDATE : cpi -> refresh_last_frame = 1 ;
cpi -> refresh_golden_frame = 1 ;
cpi -> refresh_alt_ref_frame = 1 ;
break ;
case LF_UPDATE : cpi -> refresh_last_frame = 1 ;
cpi -> refresh_golden_frame = 0 ;
cpi -> refresh_alt_ref_frame = 0 ;
break ;
case GF_UPDATE : cpi -> refresh_last_frame = 1 ;
cpi -> refresh_golden_frame = 1 ;
cpi -> refresh_alt_ref_frame = 0 ;
break ;
case OVERLAY_UPDATE : cpi -> refresh_last_frame = 0 ;
cpi -> refresh_golden_frame = 1 ;
cpi -> refresh_alt_ref_frame = 0 ;
cpi -> rc . is_src_frame_alt_ref = 1 ;
break ;
case ARF_UPDATE : cpi -> refresh_last_frame = 0 ;
cpi -> refresh_golden_frame = 0 ;
cpi -> refresh_alt_ref_frame = 1 ;
break ;
default : assert ( 0 ) ;
break ;
}
if ( is_two_pass_svc ( cpi ) ) {
if ( cpi -> svc . layer_context [ cpi -> svc . spatial_layer_id ] . gold_ref_idx < 0 ) cpi -> refresh_golden_frame = 0 ;
if ( cpi -> alt_ref_source == NULL ) cpi -> refresh_alt_ref_frame = 0 ;
}
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
int vp9_bigdia_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 bigdia_num_candidates [ MAX_PATTERN_SCALES ] = {
4 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , }
;
static const MV bigdia_candidates [ MAX_PATTERN_SCALES ] [ MAX_PATTERN_CANDIDATES ] = {
{
{
0 , - 1 }
, {
1 , 0 }
, {
0 , 1 }
, {
- 1 , 0 }
}
, {
{
- 1 , - 1 }
, {
0 , - 2 }
, {
1 , - 1 }
, {
2 , 0 }
, {
1 , 1 }
, {
0 , 2 }
, {
- 1 , 1 }
, {
- 2 , 0 }
}
, {
{
- 2 , - 2 }
, {
0 , - 4 }
, {
2 , - 2 }
, {
4 , 0 }
, {
2 , 2 }
, {
0 , 4 }
, {
- 2 , 2 }
, {
- 4 , 0 }
}
, {
{
- 4 , - 4 }
, {
0 , - 8 }
, {
4 , - 4 }
, {
8 , 0 }
, {
4 , 4 }
, {
0 , 8 }
, {
- 4 , 4 }
, {
- 8 , 0 }
}
, {
{
- 8 , - 8 }
, {
0 , - 16 }
, {
8 , - 8 }
, {
16 , 0 }
, {
8 , 8 }
, {
0 , 16 }
, {
- 8 , 8 }
, {
- 16 , 0 }
}
, {
{
- 16 , - 16 }
, {
0 , - 32 }
, {
16 , - 16 }
, {
32 , 0 }
, {
16 , 16 }
, {
0 , 32 }
, {
- 16 , 16 }
, {
- 32 , 0 }
}
, {
{
- 32 , - 32 }
, {
0 , - 64 }
, {
32 , - 32 }
, {
64 , 0 }
, {
32 , 32 }
, {
0 , 64 }
, {
- 32 , 32 }
, {
- 64 , 0 }
}
, {
{
- 64 , - 64 }
, {
0 , - 128 }
, {
64 , - 64 }
, {
128 , 0 }
, {
64 , 64 }
, {
0 , 128 }
, {
- 64 , 64 }
, {
- 128 , 0 }
}
, {
{
- 128 , - 128 }
, {
0 , - 256 }
, {
128 , - 128 }
, {
256 , 0 }
, {
128 , 128 }
, {
0 , 256 }
, {
- 128 , 128 }
, {
- 256 , 0 }
}
, {
{
- 256 , - 256 }
, {
0 , - 512 }
, {
256 , - 256 }
, {
512 , 0 }
, {
256 , 256 }
, {
0 , 512 }
, {
- 256 , 256 }
, {
- 512 , 0 }
}
, {
{
- 512 , - 512 }
, {
0 , - 1024 }
, {
512 , - 512 }
, {
1024 , 0 }
, {
512 , 512 }
, {
0 , 1024 }
, {
- 512 , 512 }
, {
- 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 , bigdia_num_candidates , bigdia_candidates ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_Cm_mediaChannel ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_h245_TransportAddress ( tvb , offset , actx , tree , hf_index ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_idct8x8_1_add_c ( const tran_low_t * input , uint8_t * dest , int stride ) {
int i , j ;
tran_high_t a1 ;
tran_low_t out = dct_const_round_shift ( input [ 0 ] * cospi_16_64 ) ;
out = dct_const_round_shift ( out * cospi_16_64 ) ;
a1 = ROUND_POWER_OF_TWO ( out , 5 ) ;
for ( j = 0 ;
j < 8 ;
++ j ) {
for ( i = 0 ;
i < 8 ;
++ i ) dest [ i ] = clip_pixel ( dest [ i ] + a1 ) ;
dest += stride ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static char * xmlrpc_parse ( char * buffer ) {
char * tmp = NULL ;
tmp = strstr ( buffer , "<?xml" ) ;
if ( tmp ) {
return xmlrpc_normalizeBuffer ( tmp ) ;
}
return NULL ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void build_config ( char * prefix , struct manager_ctx * manager , struct server * server ) {
char * path = NULL ;
int path_size = strlen ( prefix ) + strlen ( server -> port ) + 20 ;
path = ss_malloc ( path_size ) ;
snprintf ( path , path_size , "%s/.shadowsocks_%s.conf" , prefix , server -> port ) ;
FILE * f = fopen ( path , "w+" ) ;
if ( f == NULL ) {
if ( verbose ) {
LOGE ( "unable to open config file" ) ;
}
ss_free ( path ) ;
return ;
}
fprintf ( f , "{
\n" ) ;
fprintf ( f , "\"server_port\":%d,\n" , atoi ( server -> port ) ) ;
fprintf ( f , "\"password\":\"%s\"" , server -> password ) ;
if ( server -> method ) fprintf ( f , ",\n\"method\":\"%s\"" , server -> method ) ;
else if ( manager -> method ) fprintf ( f , ",\n\"method\":\"%s\"" , manager -> method ) ;
if ( server -> fast_open [ 0 ] ) fprintf ( f , ",\n\"fast_open\": %s" , server -> fast_open ) ;
if ( server -> mode ) fprintf ( f , ",\n\"mode\":\"%s\"" , server -> mode ) ;
if ( server -> plugin ) fprintf ( f , ",\n\"plugin\":\"%s\"" , server -> plugin ) ;
if ( server -> plugin_opts ) fprintf ( f , ",\n\"plugin_opts\":\"%s\"" , server -> plugin_opts ) ;
fprintf ( f , "\n}
\n" ) ;
fclose ( f ) ;
ss_free ( path ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void test_long_data_str1 ( ) {
MYSQL_STMT * stmt ;
int rc , i ;
char data [ 255 ] ;
long length ;
ulong max_blob_length , blob_length , length1 ;
my_bool true_value ;
MYSQL_RES * result ;
MYSQL_BIND my_bind [ 2 ] ;
MYSQL_FIELD * field ;
char query [ MAX_TEST_QUERY_LENGTH ] ;
myheader ( "test_long_data_str1" ) ;
rc = mysql_autocommit ( mysql , TRUE ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS test_long_data_str" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE TABLE test_long_data_str(longstr long varchar, blb long varbinary)" ) ;
myquery ( rc ) ;
strmov ( query , "INSERT INTO test_long_data_str VALUES(?, ?)" ) ;
stmt = mysql_simple_prepare ( mysql , query ) ;
check_stmt ( stmt ) ;
verify_param_count ( stmt , 2 ) ;
memset ( my_bind , 0 , sizeof ( my_bind ) ) ;
my_bind [ 0 ] . buffer = data ;
my_bind [ 0 ] . buffer_length = sizeof ( data ) ;
my_bind [ 0 ] . length = & length1 ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_STRING ;
length1 = 0 ;
my_bind [ 1 ] = my_bind [ 0 ] ;
my_bind [ 1 ] . buffer_type = MYSQL_TYPE_BLOB ;
rc = mysql_stmt_bind_param ( stmt , my_bind ) ;
check_execute ( stmt , rc ) ;
length = sprintf ( data , "MySQL AB" ) ;
for ( i = 0 ;
i < 3 ;
i ++ ) {
rc = mysql_stmt_send_long_data ( stmt , 0 , data , length ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_send_long_data ( stmt , 1 , data , 2 ) ;
check_execute ( stmt , rc ) ;
}
rc = mysql_stmt_execute ( stmt ) ;
if ( ! opt_silent ) fprintf ( stdout , " mysql_stmt_execute() returned %d\n" , rc ) ;
check_execute ( stmt , rc ) ;
mysql_stmt_close ( stmt ) ;
rc = mysql_commit ( mysql ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "SELECT LENGTH(longstr), longstr, LENGTH(blb), blb FROM test_long_data_str" ) ;
myquery ( rc ) ;
result = mysql_store_result ( mysql ) ;
mysql_field_seek ( result , 1 ) ;
field = mysql_fetch_field ( result ) ;
max_blob_length = field -> max_length ;
mytest ( result ) ;
rc = my_process_result_set ( result ) ;
DIE_UNLESS ( rc == 1 ) ;
mysql_free_result ( result ) ;
sprintf ( data , "%ld" , ( long ) i * length ) ;
verify_col_data ( "test_long_data_str" , "length(longstr)" , data ) ;
sprintf ( data , "%d" , i * 2 ) ;
verify_col_data ( "test_long_data_str" , "length(blb)" , data ) ;
stmt = mysql_simple_prepare ( mysql , "SELECT * from test_long_data_str" ) ;
check_stmt ( stmt ) ;
verify_param_count ( stmt , 0 ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_store_result ( stmt ) ;
check_execute ( stmt , rc ) ;
result = mysql_stmt_result_metadata ( stmt ) ;
field = mysql_fetch_fields ( result ) ;
DIE_UNLESS ( field -> max_length == 0 ) ;
mysql_free_result ( result ) ;
true_value = 1 ;
mysql_stmt_attr_set ( stmt , STMT_ATTR_UPDATE_MAX_LENGTH , ( void * ) & true_value ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_store_result ( stmt ) ;
check_execute ( stmt , rc ) ;
result = mysql_stmt_result_metadata ( stmt ) ;
field = mysql_fetch_fields ( result ) ;
DIE_UNLESS ( field -> max_length == max_blob_length ) ;
memset ( my_bind , 0 , sizeof ( * my_bind ) ) ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_BLOB ;
my_bind [ 0 ] . buffer = ( void * ) & data ;
my_bind [ 0 ] . buffer_length = 16 ;
my_bind [ 0 ] . length = & blob_length ;
my_bind [ 0 ] . error = & my_bind [ 0 ] . error_value ;
rc = mysql_stmt_bind_result ( stmt , my_bind ) ;
data [ 16 ] = 0 ;
rc = mysql_stmt_fetch ( stmt ) ;
DIE_UNLESS ( rc == MYSQL_DATA_TRUNCATED ) ;
DIE_UNLESS ( my_bind [ 0 ] . error_value ) ;
DIE_UNLESS ( strlen ( data ) == 16 ) ;
DIE_UNLESS ( blob_length == max_blob_length ) ;
memset ( ( my_bind + 1 ) , 0 , sizeof ( * my_bind ) ) ;
my_bind [ 1 ] . buffer_type = MYSQL_TYPE_BLOB ;
my_bind [ 1 ] . buffer = ( void * ) & data ;
my_bind [ 1 ] . buffer_length = sizeof ( data ) ;
my_bind [ 1 ] . length = & blob_length ;
memset ( data , 0 , sizeof ( data ) ) ;
mysql_stmt_fetch_column ( stmt , my_bind + 1 , 0 , 0 ) ;
DIE_UNLESS ( strlen ( data ) == max_blob_length ) ;
mysql_free_result ( result ) ;
mysql_stmt_close ( stmt ) ;
rc = mysql_query ( mysql , "DROP TABLE test_long_data_str" ) ;
myquery ( rc ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int pbase_tree_cache_ix ( const unsigned char * sha1 ) {
return sha1 [ 0 ] % ARRAY_SIZE ( pbase_tree_cache ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void get_conv_info ( packet_info * pinfo , struct _rtp_info * rtp_info ) {
conversation_t * p_conv = NULL ;
struct _rtp_conversation_info * p_conv_data = NULL ;
p_conv_data = ( struct _rtp_conversation_info * ) p_get_proto_data ( wmem_file_scope ( ) , pinfo , proto_rtp , 0 ) ;
if ( ! p_conv_data ) {
p_conv = find_conversation ( pinfo -> fd -> num , & pinfo -> net_dst , & pinfo -> net_src , pinfo -> ptype , pinfo -> destport , pinfo -> srcport , NO_ADDR_B ) ;
if ( p_conv ) {
struct _rtp_conversation_info * p_conv_packet_data ;
p_conv_data = ( struct _rtp_conversation_info * ) conversation_get_proto_data ( p_conv , proto_rtp ) ;
if ( p_conv_data ) {
guint32 seqno ;
p_conv_packet_data = wmem_new ( wmem_file_scope ( ) , struct _rtp_conversation_info ) ;
g_strlcpy ( p_conv_packet_data -> method , p_conv_data -> method , MAX_RTP_SETUP_METHOD_SIZE + 1 ) ;
p_conv_packet_data -> frame_number = p_conv_data -> frame_number ;
p_conv_packet_data -> is_video = p_conv_data -> is_video ;
p_conv_packet_data -> rtp_dyn_payload = p_conv_data -> rtp_dyn_payload ;
p_conv_packet_data -> rtp_conv_info = p_conv_data -> rtp_conv_info ;
p_conv_packet_data -> srtp_info = p_conv_data -> srtp_info ;
p_conv_packet_data -> bta2dp_info = p_conv_data -> bta2dp_info ;
p_conv_packet_data -> btvdp_info = p_conv_data -> btvdp_info ;
p_add_proto_data ( wmem_file_scope ( ) , pinfo , proto_rtp , 0 , p_conv_packet_data ) ;
seqno = calculate_extended_seqno ( p_conv_data -> extended_seqno , rtp_info -> info_seq_num ) ;
p_conv_packet_data -> extended_seqno = seqno ;
p_conv_data -> extended_seqno = seqno ;
}
}
}
if ( p_conv_data ) rtp_info -> info_setup_frame_num = p_conv_data -> frame_number ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void spl_filesystem_dir_it_move_forward ( zend_object_iterator * iter TSRMLS_DC ) {
spl_filesystem_object * object = spl_filesystem_iterator_to_object ( ( spl_filesystem_iterator * ) iter ) ;
object -> u . dir . index ++ ;
spl_filesystem_dir_read ( object TSRMLS_CC ) ;
if ( object -> file_name ) {
efree ( object -> file_name ) ;
object -> file_name = NULL ;
}
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
void * concat_gen_fifos ( void * first , void * second ) {
gen_fifo * pf1 ;
gen_fifo * pf2 ;
pf1 = first ;
pf2 = second ;
if ( NULL == pf1 ) return pf2 ;
else if ( NULL == pf2 ) return pf1 ;
CONCAT_FIFO ( * pf1 , * pf2 , link ) ;
free ( pf2 ) ;
return pf1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void StorePicturePTS ( encoder_t * p_enc , uint32_t u_pnum , mtime_t i_pts ) {
encoder_sys_t * p_sys = p_enc -> p_sys ;
for ( int i = 0 ;
i < SCHRO_PTS_TLB_SIZE ;
i ++ ) {
if ( p_sys -> pts_tlb [ i ] . b_empty ) {
p_sys -> pts_tlb [ i ] . u_pnum = u_pnum ;
p_sys -> pts_tlb [ i ] . i_pts = i_pts ;
p_sys -> pts_tlb [ i ] . b_empty = false ;
return ;
}
}
msg_Err ( p_enc , "Could not store PTS %" PRId64 " for frame %u" , i_pts , u_pnum ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static guint16 de_prog_ind ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len _U_ , gchar * add_string _U_ , int string_len _U_ ) {
guint8 oct , coding_standard , progress_description ;
guint32 curr_offset ;
curr_offset = offset ;
oct = tvb_get_guint8 ( tvb , curr_offset ) ;
coding_standard = ( oct & 0x60 ) >> 5 ;
proto_tree_add_item ( tree , hf_gsm_a_extension , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_prog_coding_standard , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_bits_item ( tree , hf_gsm_a_spare_bits , tvb , ( curr_offset << 3 ) + 3 , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_location , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
curr_offset ++ ;
oct = tvb_get_guint8 ( tvb , curr_offset ) ;
progress_description = oct & 0x7f ;
proto_tree_add_item ( tree , hf_gsm_a_extension , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
switch ( coding_standard ) {
case 0 : proto_tree_add_uint_format_value ( tree , hf_gsm_a_dtap_progress_description , tvb , curr_offset , 1 , progress_description , "%s (%u)" , val_to_str_ext_const ( progress_description , & q931_progress_description_vals_ext , "Reserved" ) , progress_description ) ;
break ;
case 1 : case 2 : proto_tree_add_item ( tree , hf_gsm_a_dtap_progress_description , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
default : proto_tree_add_uint_format_value ( tree , hf_gsm_a_dtap_progress_description , tvb , curr_offset , 1 , progress_description , "%s (%u)" , val_to_str_const ( progress_description , gsm_a_dtap_progress_description_vals , "Unspecific" ) , progress_description ) ;
break ;
}
curr_offset ++ ;
EXTRANEOUS_DATA_CHECK ( len , curr_offset - offset , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
return ( curr_offset - offset ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int64_t TSHttpTxnClientRespBodyBytesGet ( TSHttpTxn txnp ) {
sdk_assert ( sdk_sanity_check_txn ( txnp ) == TS_SUCCESS ) ;
HttpSM * sm = ( HttpSM * ) txnp ;
return sm -> client_response_body_bytes ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void sbr_hf_gen_c ( float ( * X_high ) [ 2 ] , const float ( * X_low ) [ 2 ] , const float alpha0 [ 2 ] , const float alpha1 [ 2 ] , float bw , int start , int end ) {
float alpha [ 4 ] ;
int i ;
alpha [ 0 ] = alpha1 [ 0 ] * bw * bw ;
alpha [ 1 ] = alpha1 [ 1 ] * bw * bw ;
alpha [ 2 ] = alpha0 [ 0 ] * bw ;
alpha [ 3 ] = alpha0 [ 1 ] * bw ;
for ( i = start ;
i < end ;
i ++ ) {
X_high [ i ] [ 0 ] = X_low [ i - 2 ] [ 0 ] * alpha [ 0 ] - X_low [ i - 2 ] [ 1 ] * alpha [ 1 ] + X_low [ i - 1 ] [ 0 ] * alpha [ 2 ] - X_low [ i - 1 ] [ 1 ] * alpha [ 3 ] + X_low [ i ] [ 0 ] ;
X_high [ i ] [ 1 ] = X_low [ i - 2 ] [ 1 ] * alpha [ 0 ] + X_low [ i - 2 ] [ 0 ] * alpha [ 1 ] + X_low [ i - 1 ] [ 1 ] * alpha [ 2 ] + X_low [ i - 1 ] [ 0 ] * alpha [ 3 ] + X_low [ i ] [ 1 ] ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void _slurm_rpc_layout_show ( slurm_msg_t * msg ) {
layout_info_request_msg_t * layout_req_msg = ( layout_info_request_msg_t * ) msg -> data ;
DEF_TIMERS ;
slurm_msg_t response_msg ;
char * dump ;
int dump_size ;
static int high_buffer_size = ( 1024 * 1024 ) ;
Buf buffer = init_buf ( high_buffer_size ) ;
START_TIMER ;
debug2 ( "Processing RPC: REQUEST_LAYOUT_INFO" ) ;
if ( layout_req_msg -> layout_type == NULL ) {
dump = slurm_get_layouts ( ) ;
pack32 ( ( uint32_t ) 2 , buffer ) ;
packstr ( dump , buffer ) ;
packstr ( "\n" , buffer ) ;
xfree ( dump ) ;
}
else {
if ( layouts_pack_layout ( layout_req_msg -> layout_type , layout_req_msg -> entities , layout_req_msg -> type , layout_req_msg -> flags , buffer ) != SLURM_SUCCESS ) {
debug2 ( "%s: unable to get layout[%s]" , __func__ , layout_req_msg -> layout_type ) ;
slurm_send_rc_msg ( msg , SLURM_NO_CHANGE_IN_DATA ) ;
free_buf ( buffer ) ;
return ;
}
}
dump_size = get_buf_offset ( buffer ) ;
high_buffer_size = MAX ( high_buffer_size , dump_size ) ;
dump = xfer_buf_data ( buffer ) ;
END_TIMER2 ( "_slurm_rpc_resv_show" ) ;
slurm_msg_t_init ( & response_msg ) ;
response_msg . flags = msg -> flags ;
response_msg . protocol_version = msg -> protocol_version ;
response_msg . address = msg -> address ;
response_msg . conn = msg -> conn ;
response_msg . msg_type = RESPONSE_LAYOUT_INFO ;
response_msg . data = dump ;
response_msg . data_size = dump_size ;
slurm_send_node_msg ( msg -> conn_fd , & response_msg ) ;
xfree ( dump ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int keyring_register_filename ( const char * fname , int read_only , void * * ptr ) {
KR_NAME kr ;
if ( active_handles ) BUG ( ) ;
for ( kr = kr_names ;
kr ;
kr = kr -> next ) {
if ( same_file_p ( kr -> fname , fname ) ) {
if ( read_only ) kr -> read_only = 1 ;
* ptr = kr ;
return 0 ;
}
}
kr = xmalloc ( sizeof * kr + strlen ( fname ) ) ;
strcpy ( kr -> fname , fname ) ;
kr -> read_only = read_only ;
kr -> lockhd = NULL ;
kr -> is_locked = 0 ;
kr -> did_full_scan = 0 ;
kr -> next = kr_names ;
kr_names = kr ;
if ( ! kr_offtbl ) kr_offtbl = new_offset_hash_table ( ) ;
* ptr = kr ;
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline PixelTrait GetPixelRedTraits ( const Image * restrict image ) {
return ( image -> channel_map [ RedPixelChannel ] . traits ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
gboolean lbmpdm_verify_payload ( tvbuff_t * tvb , int offset , int * encoding , int * length ) {
guint8 next_header ;
guint32 len = 0 ;
if ( ! tvb_bytes_exist ( tvb , offset , L_LBMPDM_MSG_HDR_T ) ) {
return ( FALSE ) ;
}
if ( ! check_lbmpdm_encoding ( tvb , offset , encoding ) ) {
return ( FALSE ) ;
}
next_header = tvb_get_guint8 ( tvb , offset + O_LBMPDM_MSG_HDR_T_NEXT_HDR ) ;
switch ( next_header ) {
case PDM_HDR_TYPE_DATA : case PDM_HDR_TYPE_OFSTTBLE : case PDM_HDR_TYPE_DEFN : case PDM_HDR_TYPE_EOM : break ;
default : return ( FALSE ) ;
break ;
}
len = lbmpdm_fetch_uint32_encoded ( tvb , offset + O_LBMPDM_MSG_HDR_T_LEN , * encoding ) ;
if ( len > G_MAXINT ) {
return ( FALSE ) ;
}
* length = ( int ) len ;
return ( TRUE ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int parse_CColumnSet ( tvbuff_t * tvb , int offset , proto_tree * tree , const char * fmt , ... ) {
guint32 count , v , i ;
proto_item * item ;
const char * txt ;
va_list ap ;
va_start ( ap , fmt ) ;
txt = wmem_strdup_vprintf ( wmem_packet_scope ( ) , fmt , ap ) ;
va_end ( ap ) ;
count = tvb_get_letohl ( tvb , offset ) ;
offset += 4 ;
proto_tree_add_subtree ( tree , tvb , offset , count * 4 , ett_mswsp_uin32_array , & item , txt ) ;
proto_item_append_text ( item , " Count %u [" , count ) ;
for ( i = 0 ;
i < count ;
i ++ ) {
v = tvb_get_letohl ( tvb , offset ) ;
offset += 4 ;
if ( i > 0 ) {
proto_item_append_text ( item , ",%u" , v ) ;
}
else {
proto_item_append_text ( item , "%u" , v ) ;
}
}
proto_item_append_text ( item , "]" ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int kex_method_diffie_hellman_group1_sha1_key_exchange ( LIBSSH2_SESSION * session , key_exchange_state_low_t * key_state ) {
static const unsigned char p_value [ 128 ] = {
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xC9 , 0x0F , 0xDA , 0xA2 , 0x21 , 0x68 , 0xC2 , 0x34 , 0xC4 , 0xC6 , 0x62 , 0x8B , 0x80 , 0xDC , 0x1C , 0xD1 , 0x29 , 0x02 , 0x4E , 0x08 , 0x8A , 0x67 , 0xCC , 0x74 , 0x02 , 0x0B , 0xBE , 0xA6 , 0x3B , 0x13 , 0x9B , 0x22 , 0x51 , 0x4A , 0x08 , 0x79 , 0x8E , 0x34 , 0x04 , 0xDD , 0xEF , 0x95 , 0x19 , 0xB3 , 0xCD , 0x3A , 0x43 , 0x1B , 0x30 , 0x2B , 0x0A , 0x6D , 0xF2 , 0x5F , 0x14 , 0x37 , 0x4F , 0xE1 , 0x35 , 0x6D , 0x6D , 0x51 , 0xC2 , 0x45 , 0xE4 , 0x85 , 0xB5 , 0x76 , 0x62 , 0x5E , 0x7E , 0xC6 , 0xF4 , 0x4C , 0x42 , 0xE9 , 0xA6 , 0x37 , 0xED , 0x6B , 0x0B , 0xFF , 0x5C , 0xB6 , 0xF4 , 0x06 , 0xB7 , 0xED , 0xEE , 0x38 , 0x6B , 0xFB , 0x5A , 0x89 , 0x9F , 0xA5 , 0xAE , 0x9F , 0x24 , 0x11 , 0x7C , 0x4B , 0x1F , 0xE6 , 0x49 , 0x28 , 0x66 , 0x51 , 0xEC , 0xE6 , 0x53 , 0x81 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF }
;
int ret ;
if ( key_state -> state == libssh2_NB_state_idle ) {
key_state -> p = _libssh2_bn_init_from_bin ( ) ;
key_state -> g = _libssh2_bn_init ( ) ;
_libssh2_bn_set_word ( key_state -> g , 2 ) ;
_libssh2_bn_from_bin ( key_state -> p , 128 , p_value ) ;
_libssh2_debug ( session , LIBSSH2_TRACE_KEX , "Initiating Diffie-Hellman Group1 Key Exchange" ) ;
key_state -> state = libssh2_NB_state_created ;
}
ret = diffie_hellman_sha1 ( session , key_state -> g , key_state -> p , 128 , SSH_MSG_KEXDH_INIT , SSH_MSG_KEXDH_REPLY , NULL , 0 , & key_state -> exchange_state ) ;
if ( ret == LIBSSH2_ERROR_EAGAIN ) {
return ret ;
}
_libssh2_bn_free ( key_state -> p ) ;
key_state -> p = NULL ;
_libssh2_bn_free ( key_state -> g ) ;
key_state -> g = NULL ;
key_state -> state = libssh2_NB_state_idle ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void handle_raw_data ( char * packet , int len , struct query * q , int dns_fd , int tun_fd , int userid ) {
if ( check_user_and_ip ( userid , q ) != 0 ) {
return ;
}
users [ userid ] . last_pkt = time ( NULL ) ;
memcpy ( & ( users [ userid ] . q ) , q , sizeof ( struct query ) ) ;
users [ userid ] . inpacket . offset = 0 ;
memcpy ( users [ userid ] . inpacket . data , packet , len ) ;
users [ userid ] . inpacket . len = len ;
if ( debug >= 1 ) {
fprintf ( stderr , "IN pkt raw, total %d, from user %d\n" , users [ userid ] . inpacket . len , userid ) ;
}
handle_full_packet ( tun_fd , dns_fd , userid ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int collector_decode_htmlnumericentity ( int c , void * data ) {
struct collector_htmlnumericentity_data * pc = ( struct collector_htmlnumericentity_data * ) data ;
int f , n , s , r , d , size , * mapelm ;
switch ( pc -> status ) {
case 1 : if ( c == 0x23 ) {
pc -> status = 2 ;
}
else {
pc -> status = 0 ;
( * pc -> decoder -> filter_function ) ( 0x26 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
case 2 : if ( c == 0x78 ) {
pc -> status = 4 ;
}
else if ( c >= 0x30 && c <= 0x39 ) {
pc -> cache = c - 0x30 ;
pc -> status = 3 ;
pc -> digit = 1 ;
}
else {
pc -> status = 0 ;
( * pc -> decoder -> filter_function ) ( 0x26 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( 0x23 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
case 3 : s = 0 ;
f = 0 ;
if ( c >= 0x30 && c <= 0x39 ) {
if ( pc -> digit > 9 ) {
pc -> status = 0 ;
s = pc -> cache ;
f = 1 ;
}
else {
s = pc -> cache * 10 + c - 0x30 ;
pc -> cache = s ;
pc -> digit ++ ;
}
}
else {
pc -> status = 0 ;
s = pc -> cache ;
f = 1 ;
n = 0 ;
size = pc -> mapsize ;
while ( n < size ) {
mapelm = & ( pc -> convmap [ n * 4 ] ) ;
d = s - mapelm [ 2 ] ;
if ( d >= mapelm [ 0 ] && d <= mapelm [ 1 ] ) {
f = 0 ;
( * pc -> decoder -> filter_function ) ( d , pc -> decoder ) ;
if ( c != 0x3b ) {
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
}
n ++ ;
}
}
if ( f ) {
( * pc -> decoder -> filter_function ) ( 0x26 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( 0x23 , pc -> decoder ) ;
r = 1 ;
n = pc -> digit ;
while ( n > 0 ) {
r *= 10 ;
n -- ;
}
s %= r ;
r /= 10 ;
while ( r > 0 ) {
d = s / r ;
s %= r ;
r /= 10 ;
( * pc -> decoder -> filter_function ) ( mbfl_hexchar_table [ d ] , pc -> decoder ) ;
}
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
case 4 : if ( c >= 0x30 && c <= 0x39 ) {
pc -> cache = c - 0x30 ;
pc -> status = 5 ;
pc -> digit = 1 ;
}
else if ( c >= 0x41 && c <= 0x46 ) {
pc -> cache = c - 0x41 + 10 ;
pc -> status = 5 ;
pc -> digit = 1 ;
}
else if ( c >= 0x61 && c <= 0x66 ) {
pc -> cache = c - 0x61 + 10 ;
pc -> status = 5 ;
pc -> digit = 1 ;
}
else {
pc -> status = 0 ;
( * pc -> decoder -> filter_function ) ( 0x26 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( 0x23 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( 0x78 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
case 5 : s = 0 ;
f = 0 ;
if ( ( c >= 0x30 && c <= 0x39 ) || ( c >= 0x41 && c <= 0x46 ) || ( c >= 0x61 && c <= 0x66 ) ) {
if ( pc -> digit > 9 ) {
pc -> status = 0 ;
s = pc -> cache ;
f = 1 ;
}
else {
if ( c >= 0x30 && c <= 0x39 ) {
s = pc -> cache * 16 + ( c - 0x30 ) ;
}
else if ( c >= 0x41 && c <= 0x46 ) {
s = pc -> cache * 16 + ( c - 0x41 + 10 ) ;
}
else {
s = pc -> cache * 16 + ( c - 0x61 + 10 ) ;
}
pc -> cache = s ;
pc -> digit ++ ;
}
}
else {
pc -> status = 0 ;
s = pc -> cache ;
f = 1 ;
n = 0 ;
size = pc -> mapsize ;
while ( n < size ) {
mapelm = & ( pc -> convmap [ n * 4 ] ) ;
d = s - mapelm [ 2 ] ;
if ( d >= mapelm [ 0 ] && d <= mapelm [ 1 ] ) {
f = 0 ;
( * pc -> decoder -> filter_function ) ( d , pc -> decoder ) ;
if ( c != 0x3b ) {
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
}
n ++ ;
}
}
if ( f ) {
( * pc -> decoder -> filter_function ) ( 0x26 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( 0x23 , pc -> decoder ) ;
( * pc -> decoder -> filter_function ) ( 0x78 , pc -> decoder ) ;
r = 1 ;
n = pc -> digit ;
while ( n > 0 ) {
r *= 16 ;
n -- ;
}
s %= r ;
r /= 16 ;
while ( r > 0 ) {
d = s / r ;
s %= r ;
r /= 16 ;
( * pc -> decoder -> filter_function ) ( mbfl_hexchar_table [ d ] , pc -> decoder ) ;
}
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
default : if ( c == 0x26 ) {
pc -> status = 1 ;
}
else {
( * pc -> decoder -> filter_function ) ( c , pc -> decoder ) ;
}
break ;
}
return c ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int grow ( struct evport_data * epdp , int factor ) {
struct fd_info * tmp ;
int oldsize = epdp -> ed_nevents ;
int newsize = factor * oldsize ;
assert ( factor > 1 ) ;
check_evportop ( epdp ) ;
tmp = realloc ( epdp -> ed_fds , sizeof ( struct fd_info ) * newsize ) ;
if ( NULL == tmp ) return - 1 ;
epdp -> ed_fds = tmp ;
memset ( ( char * ) ( epdp -> ed_fds + oldsize ) , 0 , ( newsize - oldsize ) * sizeof ( struct fd_info ) ) ;
epdp -> ed_nevents = newsize ;
check_evportop ( epdp ) ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void xhci_complete ( USBPort * port , USBPacket * packet ) {
XHCITransfer * xfer = container_of ( packet , XHCITransfer , packet ) ;
if ( packet -> status == USB_RET_REMOVE_FROM_QUEUE ) {
xhci_ep_nuke_one_xfer ( xfer , 0 ) ;
return ;
}
xhci_try_complete_packet ( xfer ) ;
xhci_kick_epctx ( xfer -> epctx , xfer -> streamid ) ;
if ( xfer -> complete ) {
xhci_ep_free_xfer ( xfer ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline ssize_t GetPixelChannelOffset ( const Image * restrict image , const PixelChannel channel ) {
return ( image -> channel_map [ channel ] . offset ) ;
}
| 0False
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.