Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Guard for JS number size overflows.

If you hit the maximum of a JS integer, math starts getting wonky. We
make sure at that point we wrap to 0.
  • Loading branch information...
commit 63456622ce9dc98422f1401689fe281cfe46bfd9 1 parent b86cb60
@Shadowfiend Shadowfiend authored nafg committed
View
5 web/webkit/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala
@@ -48,6 +48,11 @@ object ScriptRenderer {
toSend.responseType = responseType;
toSend.version = liftAjax.lift_ajaxVersion++;
+ // Make sure we wrap when we hit JS max int.
+ var version = liftAjax.lift_ajaxVersion
+ if ((version - (version + 1) != -1) || (version - (version - 1) != 1))
+ liftAjax.lift_ajaxVersion = 0;
+
if (liftAjax.lift_uriSuffix) {
theData += '&' + liftAjax.lift_uriSuffix;
toSend.theData = theData;
Please sign in to comment.
Something went wrong with that request. Please try again.