Skip to content

Commit

Permalink
security check for php version<7.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
shiguangqi committed Mar 1, 2019
1 parent 78333f7 commit 768b8a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions swoole_mysql_coro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,11 @@ static ssize_t mysql_decode_row_prepare(mysql_client *client, char *buf, uint32_
case SW_MYSQL_TYPE_FLOAT:
row.mfloat = *(float *) (buf + read_n);
swTraceLog(SW_TRACE_MYSQL_CLIENT, "%s=%.7f", field->name, row.mfloat);
#if PHP_VERSION_ID >= 70011
row.mdouble = _php_math_round(row.mfloat, 5, PHP_ROUND_HALF_DOWN);
#else
row.mdouble = row.mfloat;
#endif
add_assoc_double(row_array, field->name, row.mdouble);
len = sizeof(row.mfloat);
break;
Expand Down

0 comments on commit 768b8a7

Please sign in to comment.