OSSP CVS Repository

ossp - Check-in [5514]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5514
Date: 2006-Jul-24 20:54:40 (local)
2006-Jul-24 18:54:40 (UTC)
User:rse
Branch:
Comment: Fix an incorrect argument type bug in jsfile.c related to a call to js_InflateString(). A "size_t *" has to be passed, not a "size_t".
Tickets:
Inspections:
Files:
ossp-pkg/js/ChangeLog      1.4 -> 1.5     4 inserted, 0 deleted
ossp-pkg/js/src/jsfile.c      1.3 -> 1.4     9 inserted, 0 deleted

ossp-pkg/js/ChangeLog 1.4 -> 1.5

--- ChangeLog    2006/07/24 18:53:41     1.4
+++ ChangeLog    2006/07/24 18:54:40     1.5
@@ -13,6 +13,10 @@
 
   Changes between 1.6.20060722 and 1.6.20060723 (2006-07-22 to 2006-07-23)
 
+   o Fix an incorrect argument type bug in jsfile.c related to a call to
+     js_InflateString(). A "size_t *" has to be passed, not a "size_t".
+     [Ralf S. Engelschall <rse@engelschall.com>]
+
    o Upgrade from (the Mozilla Firefox 1.5 pinned version) SpiderMonkey
      1.6.20060722 to the (SPIDERMONKEY_1_6_0_BRANCH based) 1.6.20060724
      upstream version.


ossp-pkg/js/src/jsfile.c 1.3 -> 1.4

--- jsfile.c     2006/07/24 18:38:27     1.3
+++ jsfile.c     2006/07/24 18:54:41     1.4
@@ -2277,9 +2277,18 @@
     sprintf(url, "file://%s", file->path);
     /* TODO: js_escape in jsstr.h may go away at some point */
 
+#ifdef OSSP
+{
+    size_t len = strlen(url);
+    urlChars = js_InflateString(cx, url, &len);
+    if (urlChars == NULL) return JS_FALSE;
+    *rval = STRING_TO_JSVAL(js_NewString(cx, urlChars, len, 0));
+}
+#else
     urlChars = js_InflateString(cx, url, strlen(url));
     if (urlChars == NULL) return JS_FALSE;
     *rval = STRING_TO_JSVAL(js_NewString(cx, urlChars, strlen(url), 0));
+#endif
     if (!js_str_escape(cx, obj, 0, rval, rval)) return JS_FALSE;
 
     return JS_TRUE;

CVSTrac 2.0.1