)]}'
{
  "commit": "bbe790e0f3ba9e9565862067198d2760ab669ec8",
  "tree": "a6325af5094d9d638420775960dc2a0c1f07e4b2",
  "parents": [
    "2c1e595b775f6c23ec985ac20976f81dbed327e5"
  ],
  "author": {
    "name": "Sameer Agarwal",
    "email": "sameeragarwal@google.com",
    "time": "Sat Jul 07 15:14:48 2018 -0700"
  },
  "committer": {
    "name": "Sameer Agarwal",
    "email": "sameeragarwal@google.com",
    "time": "Tue Jul 10 06:17:34 2018 +0000"
  },
  "message": "Fix three out of bounds errors in CompressedRowSparseMatrix.\n\nAll three errors are of the form where, the vector storing\nthe columns array for a CompressedRowSparseMatrix is being\naccessed out of bounds. But in each case, the access is innocuous\nbecause there are other tests which prevent it from being used.\n\nHowever, if one compiles with debug mode on, the bounds checking\nin the underlying std::vector triggers an error.\n\nMore details:\n\n1. FromTripletSparseMatrix tried accessing the col vector of\n   a matrix with zero rows, but the following code was a no-op\n   because there was nothing to copy.\n\n   Adding an early return which deals with this case fixes this.\n\n2. RightMultiply and SquaredColumnNorm had the following loop\n\n   while (r \u003e cols_[idx] \u0026\u0026 idx \u003c idx_end) {\n        ++idx;\n   }\n\n   where cols_ was being accessed out of bounds, before idx \u003c idx_end\n   was being checked. Swapping the order of the comparisons fixes this\n   error.\n\n@richmattes reported this error.\n\nhttps://github.com/ceres-solver/ceres-solver/issues/383\n\nChange-Id: I2dbc90ef24ecaffc6f46f1622339d6053b43db45\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8b57956820119d29743901c8c552afc879d18251",
      "old_mode": 33188,
      "old_path": "internal/ceres/compressed_row_sparse_matrix.cc",
      "new_id": "bdb0b7abbc1bdcd6c112f307382be9b63420530a",
      "new_mode": 33188,
      "new_path": "internal/ceres/compressed_row_sparse_matrix.cc"
    }
  ]
}
