Check-in Number:
|
5680 | |
Date: |
2007-Jan-01 19:39:52 (local)
2007-Jan-01 18:39:52 (UTC) |
User: | rse |
Branch: | |
Comment: |
Fix "uuid_export" function in PHP bindings under
UUID_FMT_SIV, UUID_FMT_STR and UUID_FMT_TXT where the
NUL-termination character should be not passed back to PHP. |
Tickets: |
#147 | |
uuid_export() in PHP module returns null byte at end of string |
|
Inspections: |
|
Files: |
|
ossp-pkg/uuid/ChangeLog 1.142 -> 1.143
--- ChangeLog 2007/01/01 18:14:54 1.142
+++ ChangeLog 2007/01/01 18:39:52 1.143
@@ -13,6 +13,11 @@
Changes between 1.5.1 and 1.6.0 (31-Jul-2006 to 05-Oct-2006)
+ o Fix "uuid_export" function in PHP bindings under
+ UUID_FMT_SIV, UUID_FMT_STR and UUID_FMT_TXT where the
+ NUL-termination character should be not passed back to PHP.
+ [Neil Caunt <retardis@gmail.com>, Ralf S. Engelschall]
+
o Adjust copyright messages for new year 2007.
[Ralf S. Engelschall]
|
|
ossp-pkg/uuid/THANKS 1.12 -> 1.13
--- THANKS 2006/10/06 08:32:40 1.12
+++ THANKS 2007/01/01 18:39:52 1.13
@@ -12,6 +12,7 @@
bugfixes, hints, gave platform feedback, etc. (in alphabetical order):
o Matthias Andree <matthias.andree@gmx.de>
+ o Neil Caunt <retardis@gmail.com>
o Neil Conway <neilc@samurai.com>
o M. Daniel <mdaniel@scdi.com>
o Simon "janus" Dassow <janus@errornet.de>
|
|
ossp-pkg/uuid/php/uuid.c 1.9 -> 1.10
--- uuid.c 2007/01/01 18:14:58 1.9
+++ uuid.c 2007/01/01 18:39:52 1.10
@@ -458,6 +458,10 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "uuid_export: %s", uuid_error(rc));
RETURN_LONG((long)rc);
}
+ if (fmt == UUID_FMT_SIV)
+ data_len = strlen((char *)data_ptr);
+ else if (fmt == UUID_FMT_STR || fmt == UUID_FMT_TXT)
+ data_len--; /* PHP doesn't wish NUL-termination on strings */
ZVAL_STRINGL(z_data, data_ptr, data_len, 1);
free(data_ptr);
|
|