idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
11,800
Goffset JBIG2Stream::getPos() { if (pageBitmap == NULL) { return 0; } return dataPtr - pageBitmap->getDataPtr(); }
DoS Overflow
0
Goffset JBIG2Stream::getPos() { if (pageBitmap == NULL) { return 0; } return dataPtr - pageBitmap->getDataPtr(); }
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,801
JBIG2Bitmap *JBIG2Bitmap::getSlice(Guint x, Guint y, Guint wA, Guint hA) { JBIG2Bitmap *slice; Guint xx, yy; slice = new JBIG2Bitmap(0, wA, hA); if (slice->isOk()) { slice->clearToZero(); for (yy = 0; yy < hA; ++yy) { for (xx = 0; xx < wA; ++xx) { if (getPixel(x + xx, y + yy)) { slice-...
DoS Overflow
0
JBIG2Bitmap *JBIG2Bitmap::getSlice(Guint x, Guint y, Guint wA, Guint hA) { JBIG2Bitmap *slice; Guint xx, yy; slice = new JBIG2Bitmap(0, wA, hA); if (slice->isOk()) { slice->clearToZero(); for (yy = 0; yy < hA; ++yy) { for (xx = 0; xx < wA; ++xx) { if (getPixel(x + xx, y + yy)) { slice-...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,802
int JBIG2MMRDecoder::getWhiteCode() { const CCITTCode *p; Guint code; if (bufLen == 0) { buf = str->getChar() & 0xff; bufLen = 8; ++nBytesRead; } while (1) { if (bufLen >= 11 && ((buf >> (bufLen - 7)) & 0x7f) == 0) { if (bufLen <= 12) { code = buf << (12 - bufLen); } else { code...
DoS Overflow
0
int JBIG2MMRDecoder::getWhiteCode() { const CCITTCode *p; Guint code; if (bufLen == 0) { buf = str->getChar() & 0xff; bufLen = 8; ++nBytesRead; } while (1) { if (bufLen >= 11 && ((buf >> (bufLen - 7)) & 0x7f) == 0) { if (bufLen <= 12) { code = buf << (12 - bufLen); } else { code...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,803
inline void JBIG2Stream::mmrAddPixels(int a1, int blackPixels, int *codingLine, int *a0i, int w) { if (a1 > codingLine[*a0i]) { if (a1 > w) { error(errSyntaxError, curStr->getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1); a1 = w; } if ((*a0i & 1) ^ blackPixels) { ++*a0i; ...
DoS Overflow
0
inline void JBIG2Stream::mmrAddPixels(int a1, int blackPixels, int *codingLine, int *a0i, int w) { if (a1 > codingLine[*a0i]) { if (a1 > w) { error(errSyntaxError, curStr->getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1); a1 = w; } if ((*a0i & 1) ^ blackPixels) { ++*a0i; ...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,804
void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint length) { JBIG2HuffmanTable *huffTab; Guint flags, oob, prefixBits, rangeBits; int lowVal, highVal, val; Guint huffTabSize, i; if (!readUByte(&flags) || !readLong(&lowVal) || !readLong(&highVal)) { goto eofError; } oob = flags & 1; prefixBits =...
DoS Overflow
0
void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint length) { JBIG2HuffmanTable *huffTab; Guint flags, oob, prefixBits, rangeBits; int lowVal, highVal, val; Guint huffTabSize, i; if (!readUByte(&flags) || !readLong(&lowVal) || !readLong(&highVal)) { goto eofError; } oob = flags & 1; prefixBits =...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,805
void JBIG2Stream::readEndOfStripeSeg(Guint length) { Guint i; for (i = 0; i < length; ++i) { if (curStr->getChar() == EOF) { break; } } }
DoS Overflow
0
void JBIG2Stream::readEndOfStripeSeg(Guint length) { Guint i; for (i = 0; i < length; ++i) { if (curStr->getChar() == EOF) { break; } } }
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,806
JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h, int templ, GBool tpgdOn, GBool useSkip, JBIG2Bitmap *skip, int *atx, int *aty, int mmrDataLength) { JBIG2Bitmap *bitmap; GBool ltp; Guint ltpCX, cx, cx0, cx1, cx2; int *refLine, *codingLine; int code1, cod...
DoS Overflow
0
JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h, int templ, GBool tpgdOn, GBool useSkip, JBIG2Bitmap *skip, int *atx, int *aty, int mmrDataLength) { JBIG2Bitmap *bitmap; GBool ltp; Guint ltpCX, cx, cx0, cx1, cx2; int *refLine, *codingLine; int code1, cod...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,807
JBIG2Bitmap *JBIG2Stream::readGenericRefinementRegion(int w, int h, int templ, GBool tpgrOn, JBIG2Bitmap *refBitmap, int refDX, int refDY, int *atx, int *aty) { JBIG2Bitmap *bitmap; GBool ltp; Guint ltpCX, cx, cx0, cx2, cx3, cx4, tpgrCX0, tpgrCX1, tpgrCX2; JBIG2Bi...
DoS Overflow
0
JBIG2Bitmap *JBIG2Stream::readGenericRefinementRegion(int w, int h, int templ, GBool tpgrOn, JBIG2Bitmap *refBitmap, int refDX, int refDY, int *atx, int *aty) { JBIG2Bitmap *bitmap; GBool ltp; Guint ltpCX, cx, cx0, cx2, cx3, cx4, tpgrCX0, tpgrCX1, tpgrCX2; JBIG2Bi...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,808
void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm, GBool lossless, Guint length) { JBIG2Bitmap *bitmap; Guint w, h, x, y, segInfoFlags, extCombOp, rowCount; Guint flags, mmr, templ, tpgdOn; int atx[4], aty[4]; if (!readULong(&w) || !readULong(&h) || !readULong(&x) || !readULong(...
DoS Overflow
0
void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm, GBool lossless, Guint length) { JBIG2Bitmap *bitmap; Guint w, h, x, y, segInfoFlags, extCombOp, rowCount; Guint flags, mmr, templ, tpgdOn; int atx[4], aty[4]; if (!readULong(&w) || !readULong(&h) || !readULong(&x) || !readULong(...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,809
void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) { JBIG2PatternDict *patternDict; JBIG2Bitmap *bitmap; Guint flags, patternW, patternH, grayMax, templ, mmr; int atx[4], aty[4]; Guint i, x; if (!readUByte(&flags) || !readUByte(&patternW) || !readUByte(&patternH) || !readULo...
DoS Overflow
0
void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) { JBIG2PatternDict *patternDict; JBIG2Bitmap *bitmap; Guint flags, patternW, patternH, grayMax, templ, mmr; int atx[4], aty[4]; Guint i, x; if (!readUByte(&flags) || !readUByte(&patternW) || !readUByte(&patternH) || !readULo...
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,810
void JBIG2Stream::readProfilesSeg(Guint length) { Guint i; for (i = 0; i < length; ++i) { if (curStr->getChar() == EOF) { break; } } }
DoS Overflow
0
void JBIG2Stream::readProfilesSeg(Guint length) { Guint i; for (i = 0; i < length; ++i) { if (curStr->getChar() == EOF) { break; } } }
@@ -1495,7 +1495,7 @@ void JBIG2Stream::readSegments() { // arithmetic-coded symbol dictionary segments when numNewSyms // == 0. Segments like this often occur for blank pages. - error(errSyntaxError, curStr->getPos(), "{0:d} extraneous byte{1:s} after segment", + error(errSyntaxError, curStr->getPos(), "{0:lld...
CWE-119
null
null
11,811
PHP_FUNCTION(pg_close) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id == -1) { RETURN_FA...
DoS
0
PHP_FUNCTION(pg_close) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id == -1) { RETURN_FA...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,812
PHP_FUNCTION(pg_parameter_status) { zval *pgsql_link; int id; PGconn *pgsql; char *param; int len; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &param, &len) == SUCCESS) { id = -1; } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &param, &...
DoS
0
PHP_FUNCTION(pg_parameter_status) { zval *pgsql_link; int id; PGconn *pgsql; char *param; int len; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &param, &len) == SUCCESS) { id = -1; } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &param, &...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,813
PHP_FUNCTION(pg_query) { zval *pgsql_link = NULL; char *query; int id = -1, query_len, argc = ZEND_NUM_ARGS(); int leftover = 0; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType status; pgsql_result_handle *pg_result; if (argc == 1) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &q...
DoS
0
PHP_FUNCTION(pg_query) { zval *pgsql_link = NULL; char *query; int id = -1, query_len, argc = ZEND_NUM_ARGS(); int leftover = 0; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType status; pgsql_result_handle *pg_result; if (argc == 1) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &q...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,814
PHP_FUNCTION(pg_execute) { zval *pgsql_link = NULL; zval *pv_param_arr, **tmp; char *stmtname; int stmtname_len, id = -1, argc = ZEND_NUM_ARGS(); int leftover = 0; int num_params = 0; char **params = NULL; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType status; pgsql_result_handle *pg_result; if (arg...
DoS
0
PHP_FUNCTION(pg_execute) { zval *pgsql_link = NULL; zval *pv_param_arr, **tmp; char *stmtname; int stmtname_len, id = -1, argc = ZEND_NUM_ARGS(); int leftover = 0; int num_params = 0; char **params = NULL; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType status; pgsql_result_handle *pg_result; if (arg...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,815
PHP_FUNCTION(pg_last_notice) { zval *pgsql_link; PGconn *pg_link; int id = -1; php_pgsql_notice **notice; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { return; } /* Just to check if user passed valid resoruce */ ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id,...
DoS
0
PHP_FUNCTION(pg_last_notice) { zval *pgsql_link; PGconn *pg_link; int id = -1; php_pgsql_notice **notice; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { return; } /* Just to check if user passed valid resoruce */ ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id,...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,816
PHP_FUNCTION(pg_field_table) { zval *result; pgsql_result_handle *pg_result; long fnum = -1; zend_bool return_oid = 0; Oid oid; smart_str hash_key = {0}; char *table_name; zend_rsrc_list_entry *field_table; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|b", &result, &fnum, &return_oid) == FAILURE) {...
DoS
0
PHP_FUNCTION(pg_field_table) { zval *result; pgsql_result_handle *pg_result; long fnum = -1; zend_bool return_oid = 0; Oid oid; smart_str hash_key = {0}; char *table_name; zend_rsrc_list_entry *field_table; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|b", &result, &fnum, &return_oid) == FAILURE) {...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,817
PHP_FUNCTION(pg_field_num) { zval *result; char *field; int field_len; PGresult *pgsql_result; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result, &field, &field_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "P...
DoS
0
PHP_FUNCTION(pg_field_num) { zval *result; char *field; int field_len; PGresult *pgsql_result; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result, &field, &field_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "P...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,818
PHP_FUNCTION(pg_fetch_result) { zval *result, **field=NULL; long row; PGresult *pgsql_result; pgsql_result_handle *pg_result; int field_offset, pgsql_row, argc = ZEND_NUM_ARGS(); if (argc == 2) { if (zend_parse_parameters(argc TSRMLS_CC, "rZ", &result, &field) == FAILURE) { return; } } else { if (zend_...
DoS
0
PHP_FUNCTION(pg_fetch_result) { zval *result, **field=NULL; long row; PGresult *pgsql_result; pgsql_result_handle *pg_result; int field_offset, pgsql_row, argc = ZEND_NUM_ARGS(); if (argc == 2) { if (zend_parse_parameters(argc TSRMLS_CC, "rZ", &result, &field) == FAILURE) { return; } } else { if (zend_...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,819
PHP_FUNCTION(pg_fetch_all) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_...
DoS
0
PHP_FUNCTION(pg_fetch_all) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,820
PHP_FUNCTION(pg_fetch_all_columns) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; unsigned long colno=0; int pg_numrows, pg_row; size_t num_fields; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &colno) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE(pg_resu...
DoS
0
PHP_FUNCTION(pg_fetch_all_columns) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; unsigned long colno=0; int pg_numrows, pg_row; size_t num_fields; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &colno) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE(pg_resu...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,821
PHP_FUNCTION(pg_result_seek) { zval *result; long row; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &row) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); if (row < 0 || row >= P...
DoS
0
PHP_FUNCTION(pg_result_seek) { zval *result; long row; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &row) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); if (row < 0 || row >= P...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,822
PHP_FUNCTION(pg_free_result) { zval *result; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); if (Z_LVAL_P(result) == 0) { RETURN_FALS...
DoS
0
PHP_FUNCTION(pg_free_result) { zval *result; pgsql_result_handle *pg_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); if (Z_LVAL_P(result) == 0) { RETURN_FALS...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,823
PHP_FUNCTION(pg_last_oid) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; #ifdef HAVE_PQOIDVALUE Oid oid; #endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL re...
DoS
0
PHP_FUNCTION(pg_last_oid) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; #ifdef HAVE_PQOIDVALUE Oid oid; #endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL re...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,824
PHP_FUNCTION(pg_trace) { char *z_filename, *mode = "w"; int z_filename_len, mode_len; zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; FILE *fp = NULL; php_stream *stream; id = PGG(default_link); if (zend_parse_parameters(argc TSRMLS_CC, "p|sr", &z_filename, &z_filename_len, &mode,...
DoS
0
PHP_FUNCTION(pg_trace) { char *z_filename, *mode = "w"; int z_filename_len, mode_len; zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; FILE *fp = NULL; php_stream *stream; id = PGG(default_link); if (zend_parse_parameters(argc TSRMLS_CC, "p|sr", &z_filename, &z_filename_len, &mode,...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,825
PHP_FUNCTION(pg_untrace) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id == -1) { RETUR...
DoS
0
PHP_FUNCTION(pg_untrace) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id == -1) { RETUR...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,826
PHP_FUNCTION(pg_lo_create) { zval *pgsql_link = NULL, *oid = NULL; PGconn *pgsql; Oid pgsql_oid, wanted_oid = InvalidOid; int id = -1, argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "|zz", &pgsql_link, &oid) == FAILURE) { return; } if ((argc == 1) && (Z_TYPE_P(pgsql_link) != IS_RESOURCE)) ...
DoS
0
PHP_FUNCTION(pg_lo_create) { zval *pgsql_link = NULL, *oid = NULL; PGconn *pgsql; Oid pgsql_oid, wanted_oid = InvalidOid; int id = -1, argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "|zz", &pgsql_link, &oid) == FAILURE) { return; } if ((argc == 1) && (Z_TYPE_P(pgsql_link) != IS_RESOURCE)) ...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,827
PHP_FUNCTION(pg_lo_unlink) { zval *pgsql_link = NULL; long oid_long; char *oid_string, *end_ptr; int oid_strlen; PGconn *pgsql; Oid oid; int id = -1; int argc = ZEND_NUM_ARGS(); /* accept string type since Oid type is unsigned int */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, ...
DoS
0
PHP_FUNCTION(pg_lo_unlink) { zval *pgsql_link = NULL; long oid_long; char *oid_string, *end_ptr; int oid_strlen; PGconn *pgsql; Oid oid; int id = -1; int argc = ZEND_NUM_ARGS(); /* accept string type since Oid type is unsigned int */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, ...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,828
PHP_FUNCTION(pg_lo_open) { zval *pgsql_link = NULL; long oid_long; char *oid_string, *end_ptr, *mode_string; int oid_strlen, mode_strlen; PGconn *pgsql; Oid oid; int id = -1, pgsql_mode=0, pgsql_lofd; int create=0; pgLofp *pgsql_lofp; int argc = ZEND_NUM_ARGS(); /* accept string type since Oid is unsigned i...
DoS
0
PHP_FUNCTION(pg_lo_open) { zval *pgsql_link = NULL; long oid_long; char *oid_string, *end_ptr, *mode_string; int oid_strlen, mode_strlen; PGconn *pgsql; Oid oid; int id = -1, pgsql_mode=0, pgsql_lofd; int create=0; pgLofp *pgsql_lofp; int argc = ZEND_NUM_ARGS(); /* accept string type since Oid is unsigned i...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,829
PHP_FUNCTION(pg_lo_close) { zval *pgsql_lofp; pgLofp *pgsql; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_lofp) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_lofp, -1, "PostgreSQL large object", le_lofp); if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) { php...
DoS
0
PHP_FUNCTION(pg_lo_close) { zval *pgsql_lofp; pgLofp *pgsql; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_lofp) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_lofp, -1, "PostgreSQL large object", le_lofp); if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) { php...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,830
PHP_FUNCTION(pg_lo_read) { zval *pgsql_id; long len; int buf_len = PGSQL_LO_READ_BUF_SIZE, nbytes, argc = ZEND_NUM_ARGS(); char *buf; pgLofp *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &pgsql_id, &len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large...
DoS
0
PHP_FUNCTION(pg_lo_read) { zval *pgsql_id; long len; int buf_len = PGSQL_LO_READ_BUF_SIZE, nbytes, argc = ZEND_NUM_ARGS(); char *buf; pgLofp *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &pgsql_id, &len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,831
PHP_FUNCTION(pg_lo_write) { zval *pgsql_id; char *str; long z_len; int str_len, nbytes; int len; pgLofp *pgsql; int argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &pgsql_id, &str, &str_len, &z_len) == FAILURE) { return; } if (argc > 2) { if (z_len > str_len) { php_err...
DoS
0
PHP_FUNCTION(pg_lo_write) { zval *pgsql_id; char *str; long z_len; int str_len, nbytes; int len; pgLofp *pgsql; int argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &pgsql_id, &str, &str_len, &z_len) == FAILURE) { return; } if (argc > 2) { if (z_len > str_len) { php_err...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,832
PHP_FUNCTION(pg_lo_read_all) { zval *pgsql_id; int tbytes; volatile int nbytes; char buf[PGSQL_LO_READ_BUF_SIZE]; pgLofp *pgsql; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_id) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large object", le_l...
DoS
0
PHP_FUNCTION(pg_lo_read_all) { zval *pgsql_id; int tbytes; volatile int nbytes; char buf[PGSQL_LO_READ_BUF_SIZE]; pgLofp *pgsql; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_id) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large object", le_l...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,833
PHP_FUNCTION(pg_lo_export) { zval *pgsql_link = NULL; char *file_out, *oid_string, *end_ptr; int oid_strlen; int id = -1, name_len; long oid_long; Oid oid; PGconn *pgsql; int argc = ZEND_NUM_ARGS(); /* allow string to handle large OID value correctly */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, a...
DoS
0
PHP_FUNCTION(pg_lo_export) { zval *pgsql_link = NULL; char *file_out, *oid_string, *end_ptr; int oid_strlen; int id = -1, name_len; long oid_long; Oid oid; PGconn *pgsql; int argc = ZEND_NUM_ARGS(); /* allow string to handle large OID value correctly */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, a...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,834
PHP_FUNCTION(pg_lo_seek) { zval *pgsql_id = NULL; long offset = 0, whence = SEEK_CUR; pgLofp *pgsql; int argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) { return; } if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END) { php_er...
DoS
0
PHP_FUNCTION(pg_lo_seek) { zval *pgsql_id = NULL; long offset = 0, whence = SEEK_CUR; pgLofp *pgsql; int argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) { return; } if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END) { php_er...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,835
PHP_FUNCTION(pg_lo_tell) { zval *pgsql_id = NULL; int offset = 0; pgLofp *pgsql; int argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "r", &pgsql_id) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large object", le_lofp); offset = lo_tell((PGconn *)...
DoS
0
PHP_FUNCTION(pg_lo_tell) { zval *pgsql_id = NULL; int offset = 0; pgLofp *pgsql; int argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "r", &pgsql_id) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pgsql, pgLofp *, &pgsql_id, -1, "PostgreSQL large object", le_lofp); offset = lo_tell((PGconn *)...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,836
PHP_FUNCTION(pg_set_client_encoding) { char *encoding; int encoding_len; zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (argc == 1) { if (zend_parse_parameters(argc TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) { return; } id = PGG(default_link); CHECK_DEFAULT_...
DoS
0
PHP_FUNCTION(pg_set_client_encoding) { char *encoding; int encoding_len; zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (argc == 1) { if (zend_parse_parameters(argc TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) { return; } id = PGG(default_link); CHECK_DEFAULT_...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,837
PHP_FUNCTION(pg_client_encoding) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id == -1) { ...
DoS
0
PHP_FUNCTION(pg_client_encoding) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id == -1) { ...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,838
PHP_FUNCTION(pg_end_copy) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; int result = 0; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id...
DoS
0
PHP_FUNCTION(pg_end_copy) { zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; int result = 0; if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); } if (pgsql_link == NULL && id...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,839
PHP_FUNCTION(pg_put_line) { char *query; zval *pgsql_link = NULL; int query_len, id = -1; PGconn *pgsql; int result = 0, argc = ZEND_NUM_ARGS(); if (argc == 1) { if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) { return; } id = PGG(default_link); CHECK_DEFAULT_LINK(id); ...
DoS
0
PHP_FUNCTION(pg_put_line) { char *query; zval *pgsql_link = NULL; int query_len, id = -1; PGconn *pgsql; int result = 0, argc = ZEND_NUM_ARGS(); if (argc == 1) { if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) { return; } id = PGG(default_link); CHECK_DEFAULT_LINK(id); ...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,840
PHP_FUNCTION(pg_copy_to) { zval *pgsql_link; char *table_name, *pg_delim = NULL, *pg_null_as = NULL; int table_name_len, pg_delim_len, pg_null_as_len, free_pg_null = 0; char *query; int id = -1; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType status; int copydone = 0; #if !HAVE_PQGETCOPYDATA char copybu...
DoS
0
PHP_FUNCTION(pg_copy_to) { zval *pgsql_link; char *table_name, *pg_delim = NULL, *pg_null_as = NULL; int table_name_len, pg_delim_len, pg_null_as_len, free_pg_null = 0; char *query; int id = -1; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType status; int copydone = 0; #if !HAVE_PQGETCOPYDATA char copybu...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,841
PHP_FUNCTION(pg_copy_from) { zval *pgsql_link = NULL, *pg_rows; zval **tmp; char *table_name, *pg_delim = NULL, *pg_null_as = NULL; int table_name_len, pg_delim_len, pg_null_as_len; int pg_null_as_free = 0; char *query; HashPosition pos; int id = -1; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType st...
DoS
0
PHP_FUNCTION(pg_copy_from) { zval *pgsql_link = NULL, *pg_rows; zval **tmp; char *table_name, *pg_delim = NULL, *pg_null_as = NULL; int table_name_len, pg_delim_len, pg_null_as_len; int pg_null_as_free = 0; char *query; HashPosition pos; int id = -1; PGconn *pgsql; PGresult *pgsql_result; ExecStatusType st...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,842
PHP_FUNCTION(pg_escape_string) { char *from = NULL, *to = NULL; zval *pgsql_link; #ifdef HAVE_PQESCAPE_CONN PGconn *pgsql; #endif int to_len; int from_len; int id = -1; switch (ZEND_NUM_ARGS()) { case 1: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { return; ...
DoS
0
PHP_FUNCTION(pg_escape_string) { char *from = NULL, *to = NULL; zval *pgsql_link; #ifdef HAVE_PQESCAPE_CONN PGconn *pgsql; #endif int to_len; int from_len; int id = -1; switch (ZEND_NUM_ARGS()) { case 1: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { return; ...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,843
PHP_FUNCTION(pg_escape_bytea) { char *from = NULL, *to = NULL; size_t to_len; int from_len, id = -1; #ifdef HAVE_PQESCAPE_BYTEA_CONN PGconn *pgsql; #endif zval *pgsql_link; switch (ZEND_NUM_ARGS()) { case 1: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { return...
DoS
0
PHP_FUNCTION(pg_escape_bytea) { char *from = NULL, *to = NULL; size_t to_len; int from_len, id = -1; #ifdef HAVE_PQESCAPE_BYTEA_CONN PGconn *pgsql; #endif zval *pgsql_link; switch (ZEND_NUM_ARGS()) { case 1: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { return...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,844
PHP_FUNCTION(pg_unescape_bytea) { char *from = NULL, *to = NULL, *tmp = NULL; size_t to_len; int from_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { return; } #if HAVE_PQUNESCAPEBYTEA tmp = (char *)PQunescapeBytea((unsigned char*)from, &to_len); to = es...
DoS
0
PHP_FUNCTION(pg_unescape_bytea) { char *from = NULL, *to = NULL, *tmp = NULL; size_t to_len; int from_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { return; } #if HAVE_PQUNESCAPEBYTEA tmp = (char *)PQunescapeBytea((unsigned char*)from, &to_len); to = es...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,845
PHP_FUNCTION(pg_result_error) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; char *err = NULL; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, ...
DoS
0
PHP_FUNCTION(pg_result_error) { zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; char *err = NULL; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, ...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,846
PHP_FUNCTION(pg_result_error_field) { zval *result; long fieldcode; PGresult *pgsql_result; pgsql_result_handle *pg_result; char *field = NULL; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &fieldcode) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOU...
DoS
0
PHP_FUNCTION(pg_result_error_field) { zval *result; long fieldcode; PGresult *pgsql_result; pgsql_result_handle *pg_result; char *field = NULL; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &fieldcode) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOU...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,847
PHP_FUNCTION(pg_connection_status) { zval *pgsql_link = NULL; int id = -1; PGconn *pgsql; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link,...
DoS
0
PHP_FUNCTION(pg_connection_status) { zval *pgsql_link = NULL; int id = -1; PGconn *pgsql; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link,...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,848
PHP_FUNCTION(pg_transaction_status) { zval *pgsql_link = NULL; int id = -1; PGconn *pgsql; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link...
DoS
0
PHP_FUNCTION(pg_transaction_status) { zval *pgsql_link = NULL; int id = -1; PGconn *pgsql; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,849
PHP_FUNCTION(pg_connection_reset) { zval *pgsql_link; int id = -1; PGconn *pgsql; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_pli...
DoS
0
PHP_FUNCTION(pg_connection_reset) { zval *pgsql_link; int id = -1; PGconn *pgsql; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_pli...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,850
PHP_FUNCTION(pg_send_query) { zval *pgsql_link; char *query; int len; int id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &len) == FAILURE) { return; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_l...
DoS
0
PHP_FUNCTION(pg_send_query) { zval *pgsql_link; char *query; int len; int id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &len) == FAILURE) { return; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_l...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,851
PHP_FUNCTION(pg_send_query_params) { zval *pgsql_link, *pv_param_arr, **tmp; int num_params = 0; char **params = NULL; char *query; int query_len, id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa/", &pgsql_link, &query, &query_len, &p...
DoS
0
PHP_FUNCTION(pg_send_query_params) { zval *pgsql_link, *pv_param_arr, **tmp; int num_params = 0; char **params = NULL; char *query; int query_len, id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa/", &pgsql_link, &query, &query_len, &p...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,852
PHP_FUNCTION(pg_send_prepare) { zval *pgsql_link; char *query, *stmtname; int stmtname_len, query_len, id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) { return;...
DoS
0
PHP_FUNCTION(pg_send_prepare) { zval *pgsql_link; char *query, *stmtname; int stmtname_len, query_len, id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) { return;...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,853
PHP_FUNCTION(pg_send_execute) { zval *pgsql_link; zval *pv_param_arr, **tmp; int num_params = 0; char **params = NULL; char *stmtname; int stmtname_len, id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &pgsql_link, &stmtname, &stmt...
DoS
0
PHP_FUNCTION(pg_send_execute) { zval *pgsql_link; zval *pv_param_arr, **tmp; int num_params = 0; char **params = NULL; char *stmtname; int stmtname_len, id = -1; PGconn *pgsql; PGresult *res; int leftover = 0; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &pgsql_link, &stmtname, &stmt...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,854
PHP_FUNCTION(pg_get_result) { zval *pgsql_link; int id = -1; PGconn *pgsql; PGresult *pgsql_result; pgsql_result_handle *pg_result; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_li...
DoS
0
PHP_FUNCTION(pg_get_result) { zval *pgsql_link; int id = -1; PGconn *pgsql; PGresult *pgsql_result; pgsql_result_handle *pg_result; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_li...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,855
PHP_FUNCTION(pg_convert) { zval *pgsql_link, *values; char *table_name; int table_name_len; ulong option = 0; PGconn *pg_link; int id = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa|l", &pgsql_link, &table_name, &table_name_len, &values, &option) == FAILURE) { return; } if (option &...
DoS
0
PHP_FUNCTION(pg_convert) { zval *pgsql_link, *values; char *table_name; int table_name_len; ulong option = 0; PGconn *pg_link; int id = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa|l", &pgsql_link, &table_name, &table_name_len, &values, &option) == FAILURE) { return; } if (option &...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,856
static PHP_GINIT_FUNCTION(pgsql) { memset(pgsql_globals, 0, sizeof(zend_pgsql_globals)); /* Initilize notice message hash at MINIT only */ zend_hash_init_ex(&pgsql_globals->notices, 0, NULL, PHP_PGSQL_NOTICE_PTR_DTOR, 1, 0); }
DoS
0
static PHP_GINIT_FUNCTION(pgsql) { memset(pgsql_globals, 0, sizeof(zend_pgsql_globals)); /* Initilize notice message hash at MINIT only */ zend_hash_init_ex(&pgsql_globals->notices, 0, NULL, PHP_PGSQL_NOTICE_PTR_DTOR, 1, 0); }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,857
PHP_MINFO_FUNCTION(pgsql) { char buf[256]; php_info_print_table_start(); php_info_print_table_header(2, "PostgreSQL Support", "enabled"); #if HAVE_PG_CONFIG_H php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION); php_info_print_table_row(2, "PostgreSQL(libpq) ", PG_VERSION_STR); #ifdef HAVE_PGSQL_...
DoS
0
PHP_MINFO_FUNCTION(pgsql) { char buf[256]; php_info_print_table_start(); php_info_print_table_header(2, "PostgreSQL Support", "enabled"); #if HAVE_PG_CONFIG_H php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION); php_info_print_table_row(2, "PostgreSQL(libpq) ", PG_VERSION_STR); #ifdef HAVE_PGSQL_...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,858
PHP_MINIT_FUNCTION(pgsql) { REGISTER_INI_ENTRIES(); le_link = zend_register_list_destructors_ex(_close_pgsql_link, NULL, "pgsql link", module_number); le_plink = zend_register_list_destructors_ex(NULL, _close_pgsql_plink, "pgsql link persistent", module_number); le_result = zend_register_list_destructors_ex(_free_...
DoS
0
PHP_MINIT_FUNCTION(pgsql) { REGISTER_INI_ENTRIES(); le_link = zend_register_list_destructors_ex(_close_pgsql_link, NULL, "pgsql link", module_number); le_plink = zend_register_list_destructors_ex(NULL, _close_pgsql_plink, "pgsql link persistent", module_number); le_result = zend_register_list_destructors_ex(_free_...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,859
PHP_RINIT_FUNCTION(pgsql) { PGG(default_link)=-1; PGG(num_links) = PGG(num_persistent); return SUCCESS; }
DoS
0
PHP_RINIT_FUNCTION(pgsql) { PGG(default_link)=-1; PGG(num_links) = PGG(num_persistent); return SUCCESS; }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,860
PHP_RSHUTDOWN_FUNCTION(pgsql) { /* clean up notice messages */ zend_hash_clean(&PGG(notices)); /* clean up persistent connection */ zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions TSRMLS_CC); return SUCCESS; }
DoS
0
PHP_RSHUTDOWN_FUNCTION(pgsql) { /* clean up notice messages */ zend_hash_clean(&PGG(notices)); /* clean up persistent connection */ zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions TSRMLS_CC); return SUCCESS; }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,861
static void _close_pgsql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) { PGconn *link = (PGconn *)rsrc->ptr; PGresult *res; while ((res = PQgetResult(link))) { PQclear(res); } PQfinish(link); PGG(num_links)--; }
DoS
0
static void _close_pgsql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) { PGconn *link = (PGconn *)rsrc->ptr; PGresult *res; while ((res = PQgetResult(link))) { PQclear(res); } PQfinish(link); PGG(num_links)--; }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,862
static void _close_pgsql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) { PGconn *link = (PGconn *)rsrc->ptr; PGresult *res; while ((res = PQgetResult(link))) { PQclear(res); } PQfinish(link); PGG(num_persistent)--; PGG(num_links)--; }
DoS
0
static void _close_pgsql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) { PGconn *link = (PGconn *)rsrc->ptr; PGresult *res; while ((res = PQgetResult(link))) { PQclear(res); } PQfinish(link); PGG(num_persistent)--; PGG(num_links)--; }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,863
static void _free_ptr(zend_rsrc_list_entry *rsrc TSRMLS_DC) { pgLofp *lofp = (pgLofp *)rsrc->ptr; efree(lofp); }
DoS
0
static void _free_ptr(zend_rsrc_list_entry *rsrc TSRMLS_DC) { pgLofp *lofp = (pgLofp *)rsrc->ptr; efree(lofp); }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,864
static void _free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) { pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr; PQclear(pg_result->result); efree(pg_result); }
DoS
0
static void _free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) { pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr; PQclear(pg_result->result); efree(pg_result); }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,865
static int _php_pgsql_detect_identifier_escape(const char *identifier, size_t len) { size_t i; /* Handle edge case. Cannot be a escaped string */ if (len <= 2) { return FAILURE; } /* Detect double qoutes */ if (identifier[0] == '"' && identifier[len-1] == '"') { /* Detect wrong format of " inside of escaped ...
DoS
0
static int _php_pgsql_detect_identifier_escape(const char *identifier, size_t len) { size_t i; /* Handle edge case. Cannot be a escaped string */ if (len <= 2) { return FAILURE; } /* Detect double qoutes */ if (identifier[0] == '"' && identifier[len-1] == '"') { /* Detect wrong format of " inside of escaped ...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,866
static void _php_pgsql_notice_ptr_dtor(void **ptr) { php_pgsql_notice *notice = (php_pgsql_notice *)*ptr; if (notice) { efree(notice->message); efree(notice); notice = NULL; } }
DoS
0
static void _php_pgsql_notice_ptr_dtor(void **ptr) { php_pgsql_notice *notice = (php_pgsql_notice *)*ptr; if (notice) { efree(notice->message); efree(notice); notice = NULL; } }
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,867
static char * _php_pgsql_trim_message(const char *message, int *len) { register int i = strlen(message)-1; if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') { --i; } while (i>0 && (message[i] == '\r' || message[i] == '\n')) { --i; } ++i; if (len) { *len = i; } return estrnd...
DoS
0
static char * _php_pgsql_trim_message(const char *message, int *len) { register int i = strlen(message)-1; if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') { --i; } while (i>0 && (message[i] == '\r' || message[i] == '\n')) { --i; } ++i; if (len) { *len = i; } return estrnd...
@@ -5120,7 +5120,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - + if (!tmp_name) { + efree(src); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "T...
null
null
null
11,868
data_close(ftpbuf_t *ftp, databuf_t *data) { #if HAVE_OPENSSL_EXT SSL_CTX *ctx; #endif if (data == NULL) { return NULL; } if (data->listener != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { ctx = SSL_get_SSL_CTX(data->ssl_handle); SSL_CTX_free(ctx); SSL_shutdown(data->ssl_handle); SSL_free(d...
Exec Code Overflow
0
data_close(ftpbuf_t *ftp, databuf_t *data) { #if HAVE_OPENSSL_EXT SSL_CTX *ctx; #endif if (data == NULL) { return NULL; } if (data->listener != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { ctx = SSL_get_SSL_CTX(data->ssl_handle); SSL_CTX_free(ctx); SSL_shutdown(data->ssl_handle); SSL_free(d...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,869
data_writeable(ftpbuf_t *ftp, php_socket_t s) { int n; n = php_pollfd_for_ms(s, POLLOUT, 1000); if (n < 1) { #ifndef PHP_WIN32 if (n == 0) { errno = ETIMEDOUT; } #endif return 0; } return 1; }
Exec Code Overflow
0
data_writeable(ftpbuf_t *ftp, php_socket_t s) { int n; n = php_pollfd_for_ms(s, POLLOUT, 1000); if (n < 1) { #ifndef PHP_WIN32 if (n == 0) { errno = ETIMEDOUT; } #endif return 0; } return 1; }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,870
ftp_alloc(ftpbuf_t *ftp, const long size, char **response) { char buffer[64]; if (ftp == NULL || size <= 0) { return 0; } snprintf(buffer, sizeof(buffer) - 1, "%ld", size); if (!ftp_putcmd(ftp, "ALLO", buffer)) { return 0; } if (!ftp_getresp(ftp)) { return 0; } if (response) { *response = estrdup(...
Exec Code Overflow
0
ftp_alloc(ftpbuf_t *ftp, const long size, char **response) { char buffer[64]; if (ftp == NULL || size <= 0) { return 0; } snprintf(buffer, sizeof(buffer) - 1, "%ld", size); if (!ftp_putcmd(ftp, "ALLO", buffer)) { return 0; } if (!ftp_getresp(ftp)) { return 0; } if (response) { *response = estrdup(...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,871
ftp_chdir(ftpbuf_t *ftp, const char *dir) { if (ftp == NULL) { return 0; } if (ftp->pwd) { efree(ftp->pwd); ftp->pwd = NULL; } if (!ftp_putcmd(ftp, "CWD", dir)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return 0; } return 1; }
Exec Code Overflow
0
ftp_chdir(ftpbuf_t *ftp, const char *dir) { if (ftp == NULL) { return 0; } if (ftp->pwd) { efree(ftp->pwd); ftp->pwd = NULL; } if (!ftp_putcmd(ftp, "CWD", dir)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return 0; } return 1; }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,872
ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filename_len) { char *buffer; if (ftp == NULL || filename_len <= 0) { return 0; } spprintf(&buffer, 0, "CHMOD %o %s", mode, filename); if (!ftp_putcmd(ftp, "SITE", buffer)) { efree(buffer); return 0; } efree(buffer); if (!ftp_ge...
Exec Code Overflow
0
ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filename_len) { char *buffer; if (ftp == NULL || filename_len <= 0) { return 0; } spprintf(&buffer, 0, "CHMOD %o %s", mode, filename); if (!ftp_putcmd(ftp, "SITE", buffer)) { efree(buffer); return 0; } efree(buffer); if (!ftp_ge...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,873
ftp_close(ftpbuf_t *ftp) { if (ftp == NULL) { return NULL; } if (ftp->data) { data_close(ftp, ftp->data); } if (ftp->stream && ftp->closestream) { TSRMLS_FETCH(); php_stream_close(ftp->stream); } if (ftp->fd != -1) { #if HAVE_OPENSSL_EXT if (ftp->ssl_active) { SSL_shutdown(ftp->ssl_handle); SSL_f...
Exec Code Overflow
0
ftp_close(ftpbuf_t *ftp) { if (ftp == NULL) { return NULL; } if (ftp->data) { data_close(ftp, ftp->data); } if (ftp->stream && ftp->closestream) { TSRMLS_FETCH(); php_stream_close(ftp->stream); } if (ftp->fd != -1) { #if HAVE_OPENSSL_EXT if (ftp->ssl_active) { SSL_shutdown(ftp->ssl_handle); SSL_f...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,874
ftp_delete(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "DELE", path)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return 0; } return 1; }
Exec Code Overflow
0
ftp_delete(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "DELE", path)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return 0; } return 1; }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,875
ftp_exec(ftpbuf_t *ftp, const char *cmd) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "SITE EXEC", cmd)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 200) { return 0; } return 1; }
Exec Code Overflow
0
ftp_exec(ftpbuf_t *ftp, const char *cmd) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "SITE EXEC", cmd)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 200) { return 0; } return 1; }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,876
ftp_getresp(ftpbuf_t *ftp) { char *buf; if (ftp == NULL) { return 0; } buf = ftp->inbuf; ftp->resp = 0; while (1) { if (!ftp_readline(ftp)) { return 0; } /* Break out when the end-tag is found */ if (isdigit(ftp->inbuf[0]) && isdigit(ftp->inbuf[1]) && isdigit(ftp->inbuf[2]) && ftp->inbuf[3] == ' ...
Exec Code Overflow
0
ftp_getresp(ftpbuf_t *ftp) { char *buf; if (ftp == NULL) { return 0; } buf = ftp->inbuf; ftp->resp = 0; while (1) { if (!ftp_readline(ftp)) { return 0; } /* Break out when the end-tag is found */ if (isdigit(ftp->inbuf[0]) && isdigit(ftp->inbuf[1]) && isdigit(ftp->inbuf[2]) && ftp->inbuf[3] == ' ...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,877
ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC) { return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path TSRMLS_CC); }
Exec Code Overflow
0
ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC) { return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path TSRMLS_CC); }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,878
ftp_mdtm(ftpbuf_t *ftp, const char *path) { time_t stamp; struct tm *gmt, tmbuf; struct tm tm; char *ptr; int n; if (ftp == NULL) { return -1; } if (!ftp_putcmd(ftp, "MDTM", path)) { return -1; } if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } /* parse out the timestamp */ for (ptr = ft...
Exec Code Overflow
0
ftp_mdtm(ftpbuf_t *ftp, const char *path) { time_t stamp; struct tm *gmt, tmbuf; struct tm tm; char *ptr; int n; if (ftp == NULL) { return -1; } if (!ftp_putcmd(ftp, "MDTM", path)) { return -1; } if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } /* parse out the timestamp */ for (ptr = ft...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,879
ftp_mkdir(ftpbuf_t *ftp, const char *dir) { char *mkd, *end; if (ftp == NULL) { return NULL; } if (!ftp_putcmd(ftp, "MKD", dir)) { return NULL; } if (!ftp_getresp(ftp) || ftp->resp != 257) { return NULL; } /* copy out the dir from response */ if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { mkd = estrdu...
Exec Code Overflow
0
ftp_mkdir(ftpbuf_t *ftp, const char *dir) { char *mkd, *end; if (ftp == NULL) { return NULL; } if (!ftp_putcmd(ftp, "MKD", dir)) { return NULL; } if (!ftp_getresp(ftp) || ftp->resp != 257) { return NULL; } /* copy out the dir from response */ if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { mkd = estrdu...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,880
ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC) { databuf_t *data = NULL; long size; char *ptr; int ch; char arg[11]; if (ftp == NULL) { return 0; } if (!ftp_type(ftp, type)) { goto bail; } if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {...
Exec Code Overflow
0
ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC) { databuf_t *data = NULL; long size; char *ptr; int ch; char arg[11]; if (ftp == NULL) { return 0; } if (!ftp_type(ftp, type)) { goto bail; } if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,881
ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) { int size; char *data; if (strpbrk(cmd, "\r\n")) { return 0; } /* build the output buffer */ if (args && args[0]) { /* "cmd args\r\n\0" */ if (strlen(cmd) + strlen(args) + 4 > FTP_BUFSIZE) { return 0; } if (strpbrk(args, "\r\n")) { r...
Exec Code Overflow
0
ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) { int size; char *data; if (strpbrk(cmd, "\r\n")) { return 0; } /* build the output buffer */ if (args && args[0]) { /* "cmd args\r\n\0" */ if (strlen(cmd) + strlen(args) + 4 > FTP_BUFSIZE) { return 0; } if (strpbrk(args, "\r\n")) { r...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,882
ftp_readline(ftpbuf_t *ftp) { long size, rcvd; char *data, *eol; /* shift the extra to the front */ size = FTP_BUFSIZE; rcvd = 0; if (ftp->extra) { memmove(ftp->inbuf, ftp->extra, ftp->extralen); rcvd = ftp->extralen; } data = ftp->inbuf; do { size -= rcvd; for (eol = data; rcvd; rcvd--, eol++) { ...
Exec Code Overflow
0
ftp_readline(ftpbuf_t *ftp) { long size, rcvd; char *data, *eol; /* shift the extra to the front */ size = FTP_BUFSIZE; rcvd = 0; if (ftp->extra) { memmove(ftp->inbuf, ftp->extra, ftp->extralen); rcvd = ftp->extralen; } data = ftp->inbuf; do { size -= rcvd; for (eol = data; rcvd; rcvd--, eol++) { ...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,883
ftp_reinit(ftpbuf_t *ftp) { if (ftp == NULL) { return 0; } ftp_gc(ftp); ftp->nb = 0; if (!ftp_putcmd(ftp, "REIN", NULL)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 220) { return 0; } return 1; }
Exec Code Overflow
0
ftp_reinit(ftpbuf_t *ftp) { if (ftp == NULL) { return 0; } ftp_gc(ftp); ftp->nb = 0; if (!ftp_putcmd(ftp, "REIN", NULL)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 220) { return 0; } return 1; }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,884
ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "RNFR", src)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 350) { return 0; } if (!ftp_putcmd(ftp, "RNTO", dest)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return...
Exec Code Overflow
0
ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "RNFR", src)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 350) { return 0; } if (!ftp_putcmd(ftp, "RNTO", dest)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,885
ftp_rmdir(ftpbuf_t *ftp, const char *dir) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "RMD", dir)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return 0; } return 1; }
Exec Code Overflow
0
ftp_rmdir(ftpbuf_t *ftp, const char *dir) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "RMD", dir)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return 0; } return 1; }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,886
ftp_site(ftpbuf_t *ftp, const char *cmd) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "SITE", cmd)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp < 200 || ftp->resp >= 300) { return 0; } return 1; }
Exec Code Overflow
0
ftp_site(ftpbuf_t *ftp, const char *cmd) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "SITE", cmd)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp < 200 || ftp->resp >= 300) { return 0; } return 1; }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,887
ftp_size(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) { return -1; } if (!ftp_type(ftp, FTPTYPE_IMAGE)) { return -1; } if (!ftp_putcmd(ftp, "SIZE", path)) { return -1; } if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } return atol(ftp->inbuf); }
Exec Code Overflow
0
ftp_size(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) { return -1; } if (!ftp_type(ftp, FTPTYPE_IMAGE)) { return -1; } if (!ftp_putcmd(ftp, "SIZE", path)) { return -1; } if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } return atol(ftp->inbuf); }
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,888
ftp_syst(ftpbuf_t *ftp) { char *syst, *end; if (ftp == NULL) { return NULL; } /* default to cached value */ if (ftp->syst) { return ftp->syst; } if (!ftp_putcmd(ftp, "SYST", NULL)) { return NULL; } if (!ftp_getresp(ftp) || ftp->resp != 215) { return NULL; } syst = ftp->inbuf; while (*syst == ' ') ...
Exec Code Overflow
0
ftp_syst(ftpbuf_t *ftp) { char *syst, *end; if (ftp == NULL) { return NULL; } /* default to cached value */ if (ftp->syst) { return ftp->syst; } if (!ftp_putcmd(ftp, "SYST", NULL)) { return NULL; } if (!ftp_getresp(ftp) || ftp->resp != 215) { return NULL; } syst = ftp->inbuf; while (*syst == ' ') ...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,889
ftp_type(ftpbuf_t *ftp, ftptype_t type) { char typechar[2] = "?"; if (ftp == NULL) { return 0; } if (type == ftp->type) { return 1; } if (type == FTPTYPE_ASCII) { typechar[0] = 'A'; } else if (type == FTPTYPE_IMAGE) { typechar[0] = 'I'; } else { return 0; } if (!ftp_putcmd(ftp, "TYPE", typechar)) {...
Exec Code Overflow
0
ftp_type(ftpbuf_t *ftp, ftptype_t type) { char typechar[2] = "?"; if (ftp == NULL) { return 0; } if (type == ftp->type) { return 1; } if (type == FTPTYPE_ASCII) { typechar[0] = 'A'; } else if (type == FTPTYPE_IMAGE) { typechar[0] = 'I'; } else { return 0; } if (!ftp_putcmd(ftp, "TYPE", typechar)) {...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,890
my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, socklen_t *addrlen) { int n; n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) { errno = ETIMEDOUT; } #endif return -1; } re...
Exec Code Overflow
0
my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, socklen_t *addrlen) { int n; n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) { errno = ETIMEDOUT; } #endif return -1; } re...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,891
my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { int n, nr_bytes; n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) { errno = ETIMEDOUT; } #endif return -1; } #if HAVE_OPENSS...
Exec Code Overflow
0
my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { int n, nr_bytes; n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) { errno = ETIMEDOUT; } #endif return -1; } #if HAVE_OPENSS...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,892
my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { long size, sent; int n; size = len; while (size) { n = php_pollfd_for_ms(s, POLLOUT, ftp->timeout_sec * 1000); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) { errno = ETIMEDOUT...
Exec Code Overflow
0
my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { long size, sent; int n; size = len; while (size) { n = php_pollfd_for_ms(s, POLLOUT, ftp->timeout_sec * 1000); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) { errno = ETIMEDOUT...
@@ -1668,8 +1668,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') { lines++; - } else { - ...
CWE-119
null
null
11,893
PHP_FUNCTION(system) { php_exec_ex(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); }
Exec Code
0
PHP_FUNCTION(system) { php_exec_ex(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); }
@@ -380,6 +380,14 @@ PHPAPI char *php_escape_shell_arg(char *str) } } #ifdef PHP_WIN32 + if (y > 0 && '\\' == cmd[y - 1]) { + int k = 0, n = y - 1; + for (; n >= 0 && '\\' == cmd[n]; n--, k++); + if (k % 2) { + cmd[y++] = '\\...
CWE-78
null
null
11,894
PHP_FUNCTION(passthru) { php_exec_ex(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); }
Exec Code
0
PHP_FUNCTION(passthru) { php_exec_ex(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); }
@@ -380,6 +380,14 @@ PHPAPI char *php_escape_shell_arg(char *str) } } #ifdef PHP_WIN32 + if (y > 0 && '\\' == cmd[y - 1]) { + int k = 0, n = y - 1; + for (; n >= 0 && '\\' == cmd[n]; n--, k++); + if (k % 2) { + cmd[y++] = '\\...
CWE-78
null
null
11,895
PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC) { FILE *fp; char *buf; int l = 0, pclose_return; char *b, *d=NULL; php_stream *stream; size_t buflen, bufl = 0; #if PHP_SIGCHILD void (*sig_handler)() = NULL; #endif #if PHP_SIGCHILD sig_handler = signal (SIGCHLD, SIG_DFL); #en...
Exec Code
0
PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC) { FILE *fp; char *buf; int l = 0, pclose_return; char *b, *d=NULL; php_stream *stream; size_t buflen, bufl = 0; #if PHP_SIGCHILD void (*sig_handler)() = NULL; #endif #if PHP_SIGCHILD sig_handler = signal (SIGCHLD, SIG_DFL); #en...
@@ -380,6 +380,14 @@ PHPAPI char *php_escape_shell_arg(char *str) } } #ifdef PHP_WIN32 + if (y > 0 && '\\' == cmd[y - 1]) { + int k = 0, n = y - 1; + for (; n >= 0 && '\\' == cmd[n]; n--, k++); + if (k % 2) { + cmd[y++] = '\\...
CWE-78
null
null
11,896
check_fmt(struct magic_set *ms, struct magic *m) { pcre *pce; int re_options; pcre_extra *re_extra; TSRMLS_FETCH(); if (strchr(m->desc, '%') == NULL) { return 0; } if ((pce = pcre_get_compiled_regex("~%[-0-9.]*s~", &re_extra, &re_options TSRMLS_CC)) == NULL) { return -1; } else { return !pcre_exec(pc...
DoS Exec Code
0
check_fmt(struct magic_set *ms, struct magic *m) { pcre *pce; int re_options; pcre_extra *re_extra; TSRMLS_FETCH(); if (strchr(m->desc, '%') == NULL) { return 0; } if ((pce = pcre_get_compiled_regex("~%[-0-9.]*s~", &re_extra, &re_options TSRMLS_CC)) == NULL) { return -1; } else { return !pcre_exec(pc...
@@ -1037,6 +1037,9 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, if (bytecnt > nbytes) { bytecnt = nbytes; } + if (offset > bytecnt) { + offset = bytecnt; + ...
CWE-20
null
null
11,897
cvt_16(union VALUETYPE *p, const struct magic *m) { DO_CVT(h, (uint16_t)); }
DoS Exec Code
0
cvt_16(union VALUETYPE *p, const struct magic *m) { DO_CVT(h, (uint16_t)); }
@@ -1037,6 +1037,9 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, if (bytecnt > nbytes) { bytecnt = nbytes; } + if (offset > bytecnt) { + offset = bytecnt; + ...
CWE-20
null
null
11,898
cvt_64(union VALUETYPE *p, const struct magic *m) { DO_CVT(q, (uint64_t)); }
DoS Exec Code
0
cvt_64(union VALUETYPE *p, const struct magic *m) { DO_CVT(q, (uint64_t)); }
@@ -1037,6 +1037,9 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, if (bytecnt > nbytes) { bytecnt = nbytes; } + if (offset > bytecnt) { + offset = bytecnt; + ...
CWE-20
null
null
11,899
cvt_8(union VALUETYPE *p, const struct magic *m) { DO_CVT(b, (uint8_t)); }
DoS Exec Code
0
cvt_8(union VALUETYPE *p, const struct magic *m) { DO_CVT(b, (uint8_t)); }
@@ -1037,6 +1037,9 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, if (bytecnt > nbytes) { bytecnt = nbytes; } + if (offset > bytecnt) { + offset = bytecnt; + ...
CWE-20
null
null