Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4590

Use JSON.parse instead of eval on client side javascript

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.6, 1.7.2, 1.8.0, 2.0.0
    • Fix Version/s: 1.7.3, 1.9.0
    • Component/s: monitor
    • Labels:

      Description

      Right now we rely on "eval" to decode json results in the monitor display:

      vis.js

      function handleNewData() {
        if (xmlhttp.readyState!=4) {
          return;
        }
        if (xmlhttp.status!=200 || xmlhttp.responseText==null) {
          xmlReturned = true;
          return;
        }
        var newstats = eval('(' + xmlhttp.responseText + ')');
      

      We should instead use JSON.parse

        Attachments

          Activity

            People

            • Assignee:
              ctubbsii Christopher Tubbs
              Reporter:
              busbey Sean Busbey
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h