prompt stringlengths 110 484k | completion stringclasses 2
values |
|---|---|
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
long ssl_get_algorithm2(SSL *s)
{
long alg2 = s->s3->tmp.new_cipher->algorithm2;
if (TLS1_get_version(s) >= TLS1_2_VERSION &&
alg2 == (SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF))
return S... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
gnutls_session_get_data (gnutls_session_t session,
void *session_data, size_t * session_data_size)
{
gnutls_datum_t psession;
int ret;
if (session->internals.resumable == RESUME_FALSE)
return GNU... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
gnutls_session_get_data (gnutls_session_t session,
void *session_data, size_t * session_data_size)
{
gnutls_datum_t psession;
int ret;
if (session->internals.resumable == RESUME_FALSE)
return GNU... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
wgint restval, ccon *con, int count, wgint *last_expected_bytes,
FILE *warc_tmp)
{
int csock, dtsock, local_sock, res;
uerr_t err = RETROK; ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_colorspace *is, fz_colorspace *ds, fz_colorspace *ss, const fz_color_params *params)
{
int n = ss->n;
fz_cached_color_converter *cached = fz_malloc_st... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, unsigned int out, int check_for_overlap, int many)
{
int current;
cmap_splay *tree;
if (low > high)
{
fz_warn(ctx, "range limits out of range in ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
{
pdf_gstate *gstate = pr->gstate + pr->gtop;
pdf_xobject *softmask = gstate->softmask;
fz_rect mask_bbox;
fz_matrix tos_save[2], save_ctm;
fz_matrix m... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, unsigned int out, int check_for_overlap, int many)
{
int current;
cmap_splay *tree;
if (low > high)
{
fz_warn(ctx, "range limits out of range in ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
pdf_show_image(fz_context *ctx, pdf_run_processor *pr, fz_image *image)
{
pdf_gstate *gstate = pr->gstate + pr->gtop;
fz_matrix image_ctm;
fz_rect bbox;
softmask_save softmask = { NULL };
i... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
sparse_dump_region (struct tar_sparse_file *file, size_t i)
{
union block *blk;
off_t bytes_left = file->stat_info->sparse_map[i].numbytes;
if (!lseek_or_error (file, file->stat_info->sparse_map[i].offset))
return false;
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
int dns_read_name(unsigned char *buffer, unsigned char *bufend,
unsigned char *name, char *destination, int dest_len,
int *offset)
{
int nb_bytes = 0, n = 0;
int label_len;
unsig... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
int *maskColors, GBool inlineImg) {
double *ctm;
SplashCoord mat[6];
SplashOutImageData ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
int *maskColors, GBool inlineImg)
{
unsigned char *buffer;
unsigned int *dest;
int x, y;... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e)
: saml2md::DynamicMetadataProvider(e),
m_verifyHost(XMLHelper::getAttrBool(e, true, verifyHost)),
m_ignoreTransport(XMLHelper::getAttrBool(... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh,
char **target)
{
uint32_t data[1024];
uint32_t *p;
uint32_t len;
struct packet *nfs_packet;
/*
* struct READLINK3args {
* nfs_fh3 symlink;
* ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static int nfs_readlink_reply(unsigned char *pkt, unsigned len)
{
uint32_t *data;
char *path;
int rlen;
int ret;
ret = rpc_check_reply(pkt, 1);
if (ret)
return ret;
data = (uint32_t *)(pkt + sizeof(struct rpc_reply)... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
aspath_put (struct stream *s, struct aspath *as, int use32bit )
{
struct assegment *seg = as->segments;
size_t bytes = 0;
if (!seg || seg->length == 0)
return 0;
if (seg)
{
/*
* Hey, what do we do ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void sum_update(const char *p, int32 len)
{
switch (cursum_type) {
case CSUM_MD5:
md5_update(&md, (uchar *)p, len);
break;
case CSUM_MD4:
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
char *auth_server(int f_in, int f_out, int module, const char *host,
const char *addr, const char *leader)
{
char *users = lp_auth_users(module);
char challenge[MAX_DIGEST_LEN*2];
char line[BIGPATHBUFLEN];
char **auth_uid_gr... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static int get_next_block(bunzip_data *bd)
{
struct group_data *hufGroup;
int dbufCount, dbufSize, groupCount, *base, *limit, selector,
i, j, runPos, symCount, symTotal, nSelectors, byteCount[256];
int runCnt = runCnt; /* fo... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
BufCompressedFill (BufFilePtr f)
{
CompressedFile *file;
register char_type *stackp, *de_stack;
register char_type finchar;
register code_int code, oldcode, incode;
BufChar *buf, *bufend;
file = (Compre... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static int dns_parse_callback(void *c, int rr, const void *data, int len, const void *packet)
{
char tmp[256];
struct dpc_ctx *ctx = c;
switch (rr) {
case RR_A:
if (len != 4) return -1;
ctx->addrs[ctx->cnt].scopeid = 0... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
bool extractPages (const char *srcFileName, const char *destFileName) {
char pathName[4096];
GooString *gfileName = new GooString (srcFileName);
PDFDoc *doc = new PDFDoc (gfileName, NULL, NULL, NULL);
if (!doc->isOk()) {
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
bool extractPages (const char *srcFileName, const char *destFileName) {
char pathName[1024];
GooString *gfileName = new GooString (srcFileName);
PDFDoc *doc = new PDFDoc (gfileName, NULL, NULL, NULL);
if (!doc->isOk()) ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
walk_string(fz_context *ctx, int uni, int remove, editable_str *str)
{
int rune;
if (str->utf8 == NULL)
return;
do
{
char *s = &str->utf8[str->pos];
size_t len;
int n = fz_chartorun... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void red_channel_pipes_add_empty_msg(RedChannel *channel, int msg_type)
{
RingItem *link;
RING_FOREACH(link, &channel->clients) {
red_channel_client_pipe_add_empty_msg(
SPICE_CONTAINEROF(link, RedCh... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void red_channel_pipes_add_type(RedChannel *channel, int pipe_item_type)
{
RingItem *link;
RING_FOREACH(link, &channel->clients) {
red_channel_client_pipe_add_type(
SPICE_CONTAINEROF(link, RedChanne... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
x11_open_helper(Buffer *b)
{
u_char *ucp;
u_int proto_len, data_len;
u_char *ucp;
u_int proto_len, data_len;
/* Check if the fixed size part of the packet is in buffer. */
if (buffer_len(b) < 12)
return 0;
debug2("... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
_PUBLIC_ codepoint_t next_codepoint_handle_ext(
struct smb_iconv_handle *ic,
const char *str, size_t len,
charset_t src_charset,
size_t *bytes_consumed)
{
/* it cannot occupy more than 4 bytes in UTF16 format */
uint8_... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static int ldb_dn_escape_internal(char *dst, const char *src, int len)
{
const char *p, *s;
char *d;
size_t l;
p = s = src;
d = dst;
while (p - src < len) {
p += strcspn... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
_PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
TALLOC_CTX *ctx, const char *src, size_t n)
{
size_t size=0;
char *dest;
if (!src) {
return NULL;
}
/* this takes advantage of the fact tha... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static bool ldb_dn_explode(struct ldb_dn *dn)
{
char *p, *ex_name = NULL, *ex_value = NULL, *data, *d, *dt, *t;
bool trim = true;
bool in_extended = true;
bool in_ex_name = false;
bool in_ex_value = false;
bool in_attr = false... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
gs_call_interp(i_ctx_t **pi_ctx_p, ref * pref, int user_errors,
int *pexit_code, ref * perror_object)
{
ref *epref = pref;
ref doref;
ref *perrordict;
ref error_name;
int code, ccode;
ref saref... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
const char *fname,
struct smb_request *smbreq)
{
NTSTATUS status;
TALLOC_CTX *ctx = talloc_tos();
const char *conn_rootdir;
size_t rootdir_len;
char *dir... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
plan_a (char const *filename)
{
char const *s;
char const *lim;
char const **ptr;
char *buffer;
lin iline;
size_t size = instat.st_size;
/* Fail if the file size doesn't fit in a size_t,
or if storage isn't avail... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
_dbus_header_byteswap (DBusHeader *header,
int new_order)
{
if (header->byte_order == new_order)
return;
_dbus_marshal_byteswap (&_dbus_header_signature_str,
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
gs_nulldevice(gs_gstate * pgs)
{
int code = 0;
if (pgs->device == 0 || !gx_device_is_null(pgs->device)) {
gx_device *ndev;
code = gs_copydevice(&ndev, (const gx_device *)&gs_null_device,
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
zrestore(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
alloc_save_t *asave;
bool last;
vm_save_t *vmsave;
int code = restore_check_operand(op, &asave, idmemory);
if (code < 0)
return code;
if_debug2... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
destroy_one_secret (gpointer data)
{
char *secret = (char *) data;
/* Don't leave the secret lying around in memory */
g_message ("%s: destroying %s", __func__, secret);
memset (secret, 0, strlen (secret));
g_free (secret)... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
PatternMatch(char *pat, int patdashes, char *string, int stringdashes)
{
char c,
t;
if (stringdashes < patdashes)
return 0;
for (;;) {
switch (c = *pat++) {
case '*':
if (!(c = *pat++))
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
gs_call_interp(i_ctx_t **pi_ctx_p, ref * pref, int user_errors,
int *pexit_code, ref * perror_object)
{
ref *epref = pref;
ref doref;
ref *perrordict;
ref error_name;
int code, ccode;
ref saref... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
gs_main_finit(gs_main_instance * minst, int exit_status, int code)
{
i_ctx_t *i_ctx_p = minst->i_ctx_p;
gs_dual_memory_t dmem = {0};
int exit_code;
ref error_object;
char *tempnames;
/* NB: need to free gs_n... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
zsetcolor(i_ctx_t * i_ctx_p)
{
os_ptr op = osp;
es_ptr ep;
const gs_color_space * pcs = gs_currentcolorspace(igs);
gs_client_color cc;
int n_comps, n_numeric_comps, n... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
ztype(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
ref tnref;
int code = array_get(imemory, op, (long)r_btype(op - 1), &tnref);
if (code < 0)
return code;
if (!r_has_type(&tnref, t_name)) {
/* Must be e... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
fd_read_body (const char *downloaded_filename, int fd, FILE *out, wgint toread, wgint startpos,
wgint *qtyread, wgint *qtywritten, double *elapsed, int flags,
FILE *out2)
{
int ret = 0;
#undef max
#def... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
struct edid *drm_load_edid_firmware(struct drm_connector *connector)
{
const char *connector_name = connector->name;
char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL;
struct edid *edid;
if (edid_firmware[0] == ... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void buffer_slow_realign(struct buffer *buf)
{
/* two possible cases :
* - the buffer is in one contiguous block, we move it in-place
* - the buffer is in two blocks, we move it via the swap_buffer
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
new_msg_register_event (u_int32_t seqnum, struct lsa_filter_type *filter)
{
u_char buf[OSPF_API_MAX_MSG_SIZE];
struct msg_register_event *emsg;
int len;
emsg = (struct msg_register_event *) buf;
len = sizeof (struct msg_r... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
const ASN1_TEMPLATE *tt, *errtt = NULL;
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg,
X509_ALGOR **pmaskHash)
{
const unsigned char *p;
int plen;
RSA_PSS_PARAMS *pss;
*pmaskHash = NULL;
if (!alg->p... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg)
{
const unsigned char *p;
int plen;
if (alg == NULL)
return NULL;
if (OBJ_obj2nid(alg->algorithm) != NID_mgf1)
return NULL;
if (alg->param... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
int test_mod_exp(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *c, *d, *e;
int i;
a = BN_new();
b = BN_new();
c = BN_new();
d = BN_new();
e = BN_new();
BN_one(a);
BN_one(b);
BN_zero(c);
if (BN_... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
_asn1_ltostr (long v, char *str)
{
long d, r;
char temp[LTOSTR_MAX_SIZE];
int count, k, start;
if (v < 0)
{
str[0] = '-';
start = 1;
v = -v;
}
else
start = 0;
count = 0;
do
{
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
token_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save)
{
os_ptr op = osp;
int code;
ref token;
/* Note that gs_scan_token may change osp! */
pop(1); /* remove the file or sc... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
ft_smooth_render_generic( FT_Renderer render,
FT_GlyphSlot slot,
FT_Render_Mode mode,
const FT_Vector* origin,
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
cff_charset_load( CFF_Charset charset,
FT_UInt num_glyphs,
FT_Stream stream,
FT_ULong base_offset,
FT_ULong offset,
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
void add_param_to_argv(char *parsestart, int line)
{
int quote_open = 0, escaped = 0, param_len = 0;
char param_buffer[1024], *curchar;
/* After fighting with strtok enough, here's now
* a 'real' parser. According to Rust... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
user_change_icon_file_authorized_cb (Daemon *daemon,
User *user,
GDBusMethodInvocation *context,
... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
ProcSendEvent(ClientPtr client)
{
WindowPtr pWin;
WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
DeviceIntPtr dev = PickPointer(client);
DeviceIntPtr keybd = GetMaster(dev, MASTER_KEYB... | VULNERABLE |
Analyze this C/C++ function for vulnerabilities. Answer only SAFE or VULNERABLE.
Code:
ProcXSendExtensionEvent(ClientPtr client)
{
int ret;
DeviceIntPtr dev;
xEvent *first;
XEventClass *list;
struct tmask tmp[EMASKSIZE];
REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExte... | VULNERABLE |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 13