Changeset 30640 in project


Ignore:
Timestamp:
04/03/14 20:11:01 (7 years ago)
Author:
sjamaan
Message:

postgresql: Fix escape-string bug in string length calculation, returning overlong strings with trailing whitespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/postgresql/trunk/postgresql.scm

    r30479 r30640  
    11221122  (let-location ((err bool))
    11231123    (let* ((strlen (string-length str))
    1124            (buffer (make-string (add1 (* strlen 2))))
     1124           (buflen (make-string (add1 (* strlen 2))))
     1125           (buffer buflen)
    11251126           (size (%escape-string-conn (pg-connection-ptr conn) buffer str strlen (location err))))
    11261127      (cond (err (postgresql-error 'internal 'escape-string
    11271128                                   (conc "String escaping failed. "
    11281129                                         (PQerrorMessage conn)) conn str))
    1129             ((fx= size strlen) buffer)
     1130            ((fx= size buflen) buffer)
    11301131            (else (##sys#substring buffer 0 size))))))
    11311132
Note: See TracChangeset for help on using the changeset viewer.