Skip to content

Commit

Permalink
[FP] Dereference of null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Oct 18, 2013
1 parent 2caf2ba commit d4fd9d9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ext/mvc/model/resultset/complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, valid){
* The result type=1 so we need to build every row
*/
if (zend_is_true(type)) {

int i_hydrate_mode;
/**
* Get current hydration mode
*/
Expand All @@ -196,8 +196,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, valid){
/**
* Each row in a complex result is a Phalcon\Mvc\Model\Row instance
*/

switch (phalcon_get_intval(hydrate_mode)) {
i_hydrate_mode = phalcon_get_intval(hydrate_mode);
switch (i_hydrate_mode) {

case 0:
PHALCON_INIT_VAR(active_row);
Expand Down Expand Up @@ -280,7 +280,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, valid){
* Generate the column value according to the hydration type
*/

switch (phalcon_get_intval(hydrate_mode)) {
switch (i_hydrate_mode) {

case 0:
/**
Expand Down Expand Up @@ -353,12 +353,15 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, valid){
PHALCON_CPY_WRT(attribute, n_alias);
}
}

if (!attribute) {
PHALCON_INIT_NVAR(attribute);
}

/**
* Assign the instance according to the hydration type
*/

switch (phalcon_get_intval(hydrate_mode)) {
switch (i_hydrate_mode) {

case 1:
phalcon_array_update_zval(&active_row, attribute, &value, PH_COPY | PH_SEPARATE);
Expand Down

0 comments on commit d4fd9d9

Please sign in to comment.