project stringclasses 633
values | commit_id stringlengths 7 81 | target int64 0 1 | func stringlengths 5 484k | cwe stringclasses 131
values | big_vul_idx float64 0 189k ⌀ | idx int64 0 522k | hash stringlengths 34 39 | size float64 1 24k ⌀ | message stringlengths 0 11.5k ⌀ | dataset stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
sqlcipher | cb71f53e8cea4802509f182fa5bead0ac6ab0e7f | 0 | int sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey) {
CODEC_TRACE("sqlite3_rekey entered: db=%p pKey=%s nKey=%d\n", db, (char *)pKey, nKey);
return sqlite3_rekey_v2(db, "main", pKey, nKey);
} | CWE-476 | null | 521,513 | 124990925950342494676970472549811023531 | null | null | other |
sqlcipher | cb71f53e8cea4802509f182fa5bead0ac6ab0e7f | 0 | int sqlite3_key_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey) {
CODEC_TRACE("sqlite3_key_v2: entered db=%p zDb=%s pKey=%s nKey=%d\n", db, zDb, (char *)pKey, nKey);
/* attach key if db and pKey are not null and nKey is > 0 */
if(db && pKey && nKey) {
int db_index = sqlcipher_find_db_index(db, zD... | CWE-476 | null | 521,514 | 73166029779090012427420417688273038704 | null | null | other |
sqlcipher | cb71f53e8cea4802509f182fa5bead0ac6ab0e7f | 0 | int sqlcipher_find_db_index(sqlite3 *db, const char *zDb) {
int db_index;
if(zDb == NULL){
return 0;
}
for(db_index = 0; db_index < db->nDb; db_index++) {
struct Db *pDb = &db->aDb[db_index];
if(strcmp(pDb->zDbSName, zDb) == 0) {
return db_index;
}
}
return 0;
} | CWE-476 | null | 521,515 | 289985726554989780948533248680267463560 | null | null | other |
sqlcipher | cb71f53e8cea4802509f182fa5bead0ac6ab0e7f | 0 | void sqlite3CodecGetKey(sqlite3* db, int nDb, void **zKey, int *nKey) {
struct Db *pDb = &db->aDb[nDb];
CODEC_TRACE("sqlite3CodecGetKey: entered db=%p, nDb=%d\n", db, nDb);
if( pDb->pBt ) {
codec_ctx *ctx = (codec_ctx*) sqlite3PagerGetCodec(pDb->pBt->pBt->pPager);
if(ctx) {
/* pass back the key... | CWE-476 | null | 521,516 | 171276717307175347937129546147676145159 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::reset) {
Nan::HandleScope scope;
TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This());
if (!tw->txn) {
return Nan::ThrowError("The transaction is already closed.");
}
mdb_txn_reset(tw->txn);
} | NVD-CWE-noinfo | null | 522,366 | 111754536856151020384296457165593354112 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::getStringUnsafe) {
return getCommon(info, valToStringUnsafe);
} | NVD-CWE-noinfo | null | 522,367 | 327997749649427003529712935162733995691 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | TxnWrap::~TxnWrap() {
// Close if not closed already
if (this->txn) {
mdb_txn_abort(txn);
this->removeFromEnvWrap();
}
} | NVD-CWE-noinfo | null | 522,368 | 98633485475874360673390197125564066465 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::renew) {
Nan::HandleScope scope;
TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This());
if (!tw->txn) {
return Nan::ThrowError("The transaction is already closed.");
}
int rc = mdb_txn_renew(tw->txn);
if (rc != 0) {
return throwLmdbError(rc);
}
} | NVD-CWE-noinfo | null | 522,369 | 330310888177677195012960504845799002590 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::getBinaryUnsafe) {
return getCommon(info, valToBinaryUnsafe);
} | NVD-CWE-noinfo | null | 522,370 | 154435709708493451549133124651591851111 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | TxnWrap::TxnWrap(MDB_env *env, MDB_txn *txn) {
this->env = env;
this->txn = txn;
this->flags = 0;
} | NVD-CWE-noinfo | null | 522,371 | 20378928412779517955065624189665146904 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::putString) {
if (!info[2]->IsString())
return Nan::ThrowError("Value must be a string.");
return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void {
CustomExternalStringResource::writeTo(Local<String>::Cast(info[2]), &data);
}, [](MDB_val &data) ->... | NVD-CWE-noinfo | null | 522,372 | 90464922304161758037637442655888907352 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::putNumber) {
return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void {
auto numberLocal = Nan::To<v8::Number>(info[2]).ToLocalChecked();
numberToPut = numberLocal->Value();
data.mv_size = sizeof(double);
data.mv_data = &numberToPut;
}... | NVD-CWE-noinfo | null | 522,373 | 84506492187481645784841167051352604929 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::del) {
Nan::HandleScope scope;
// Check argument count
auto argCount = info.Length();
if (argCount < 2 || argCount > 4) {
return Nan::ThrowError("Invalid number of arguments to cursor.del, should be: (a) <dbi>, <key> (b) <dbi>, <key>, <options> (c) <dbi>, <key>, <data> (... | NVD-CWE-noinfo | null | 522,374 | 113262016694954010326776401196468291122 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::abort) {
Nan::HandleScope scope;
TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This());
if (!tw->txn) {
return Nan::ThrowError("The transaction is already closed.");
}
mdb_txn_abort(tw->txn);
tw->removeFromEnvWrap();
tw->txn = nullptr;
} | NVD-CWE-noinfo | null | 522,375 | 313693146167928649072324880144071248063 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::ctor) {
Nan::HandleScope scope;
EnvWrap *ew = Nan::ObjectWrap::Unwrap<EnvWrap>(Local<Object>::Cast(info[0]));
int flags = 0;
if (info[1]->IsObject()) {
Local<Object> options = Local<Object>::Cast(info[1]);
// Get flags from options
setFlagFromValue(&flags,... | NVD-CWE-noinfo | null | 522,376 | 130133738190316414134316419765674120458 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::getBoolean) {
return getCommon(info, valToBoolean);
} | NVD-CWE-noinfo | null | 522,377 | 140582431524336829375468712395069094706 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::getBinary) {
return getCommon(info, valToBinary);
} | NVD-CWE-noinfo | null | 522,378 | 115129818850744078520114658161971092253 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::commit) {
Nan::HandleScope scope;
TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This());
if (!tw->txn) {
return Nan::ThrowError("The transaction is already closed.");
}
int rc = mdb_txn_commit(tw->txn);
tw->removeFromEnvWrap();
tw->txn = nullptr;
if ... | NVD-CWE-noinfo | null | 522,379 | 121301977646653559366311180269817451923 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | void TxnWrap::removeFromEnvWrap() {
if (this->ew) {
if (this->ew->currentWriteTxn == this) {
this->ew->currentWriteTxn = nullptr;
}
else {
auto it = std::find(ew->readTxns.begin(), ew->readTxns.end(), this);
if (it != ew->readTxns.end()) {
... | NVD-CWE-noinfo | null | 522,380 | 296317506903370523961617565214117428395 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | Nan::NAN_METHOD_RETURN_TYPE TxnWrap::getCommon(Nan::NAN_METHOD_ARGS_TYPE info, Local<Value> (*successFunc)(MDB_val&)) {
Nan::HandleScope scope;
if (info.Length() != 2 && info.Length() != 3) {
return Nan::ThrowError("Invalid number of arguments to cursor.get");
}
TxnWrap *tw = Nan::ObjectWr... | NVD-CWE-noinfo | null | 522,381 | 211795776106805654192569309739126203417 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::getNumber) {
return getCommon(info, valToNumber);
} | NVD-CWE-noinfo | null | 522,382 | 29985559570653563433965292448894091320 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | Nan::NAN_METHOD_RETURN_TYPE TxnWrap::putCommon(Nan::NAN_METHOD_ARGS_TYPE info, void (*fillFunc)(Nan::NAN_METHOD_ARGS_TYPE info, MDB_val&), void (*freeData)(MDB_val&)) {
Nan::HandleScope scope;
if (info.Length() != 3 && info.Length() != 4) {
return Nan::ThrowError("Invalid number of arguments to txn... | NVD-CWE-noinfo | null | 522,383 | 327504724290267669545503796104615648541 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::putBinary) {
return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void {
data.mv_size = node::Buffer::Length(info[2]);
data.mv_data = node::Buffer::Data(info[2]);
}, [](MDB_val &) -> void {
// The data is owned by the node::Buffer so we don't ne... | NVD-CWE-noinfo | null | 522,384 | 274366162858498806842651231303117952613 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::getString) {
return getCommon(info, valToString);
} | NVD-CWE-noinfo | null | 522,385 | 50804322121229586582284772344515302237 | null | null | other |
node-lmdb | 97760104c0fd311206b88aecd91fa1f59fe2b85a | 0 | NAN_METHOD(TxnWrap::putBoolean) {
return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void {
auto booleanLocal = Nan::To<v8::Boolean>(info[2]).ToLocalChecked();
booleanToPut = booleanLocal->Value();
data.mv_size = sizeof(bool);
data.mv_data = &booleanToPut;
... | NVD-CWE-noinfo | null | 522,386 | 3239950279361858703082378303053726488 | null | null | other |
maddy | 7ee6a39c6a1939b376545f030a5efd6f90913583 | 0 | static int conv_func(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {
*resp = (struct pam_response*)appdata_ptr;
return PAM_SUCCESS;
} | CWE-613 | null | 522,442 | 240159382519350654004395498659051294070 | null | null | other |
maddy | 7ee6a39c6a1939b376545f030a5efd6f90913583 | 0 | struct error_obj run_pam_auth(const char *username, char *password) {
// PAM frees pam_response for us.
struct pam_response *reply = malloc(sizeof(struct pam_response));
if (reply == NULL) {
struct error_obj ret_val;
ret_val.status = 2;
ret_val.func_name = "malloc";
ret_val.e... | CWE-613 | null | 522,443 | 283443869067414917158176917086877093267 | null | null | other |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.