php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52546
Patch fix_pdo_dblib_MONEY_seg_fault_5.2.14 revision 2010-08-06 16:17 UTC by rgagnon24 at gmail dot com
revision 2010-08-05 20:11 UTC by rgagnon24 at gmail dot com
revision 2010-08-05 20:07 UTC by rgagnon24 at gmail dot com

Patch fix_pdo_dblib_MONEY_seg_fault_5.2.14 for PDO related Bug #52546

Patch version 2010-08-05 20:11 UTC

Return to Bug #52546 | Download this patch
This patch is obsolete

Obsoleted by patches:

This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2010-08-06 16:17 UTC | 2010-08-05 20:11 UTC | 2010-08-05 20:07 UTC

Developer: rgagnon24@gmail.com



  --- dblib_stmt.c	2010-03-08 06:39:44.000000000 -0600
 +++ dblib_stmt.c.bak	2010-08-05 10:44:59.000000000 -0500
 +++ dblib_stmt.c.bak	2010-08-05 10:58:36.000000000 -0500
  @@ -170,8 +170,11 @@
   					case SQLMONEY4:
   					case SQLMONEYN: {
   						DBFLT8 money_value;
  +						val->len = 32 + (2 * dbdatlen(H->link, i+1));
  +						val->data = emalloc(val->len);
   						dbconvert(NULL, S->cols[i].coltype, dbdata(H->link, i+1), dbdatlen(H->link, i+1), SQLFLT8, (LPBYTE)&money_value, val->len);
  -						val->len = spprintf(val->data, 0, "%.4f", money_value);
 +						sprintf(val->data, "%f", money_value);
 +						sprintf(val->data, "%.4f", money_value);
  +						val->len = strlen(val->data);
   						}
   						break;
   					default:
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 08:02:55 2014 UTC