Skip to content

Commit fc05e22

Browse files
authored
fix segfault pertaining to sliding window bounds (#113)
1 parent 1226820 commit fc05e22

File tree

5 files changed

+27
-28
lines changed

5 files changed

+27
-28
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
1+
# syntax=docker/dockerfile:1@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
22

33
FROM ubuntu:20.04@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 AS base
44
WORKDIR /app

resolved.bzl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ resolved = [
221221
"rule_class": "@bazel_upgradable//:rule.bzl%upgradable_repository",
222222
"attributes": {
223223
"urls": [
224-
"https://github.com/glfw/glfw/archive/d3317b49373ced81a458008316dd5b6115d26df8.tar.gz",
224+
"https://github.com/glfw/glfw/archive/19543afbfb3856e5ef7d5954ad795e1077e82550.tar.gz",
225225
],
226-
"sha256": "de8cd84b459d8d1df436c0c2514897b9799ee5f3b3aa502a930e2a9ab97c6ad3",
226+
"sha256": "5ba92275b87d329ec4cd21a257a3c295cfd471a86a254aa45434936af241da4d",
227227
"netrc": "",
228228
"auth_patterns": {},
229229
"canonical_id": "",
230-
"strip_prefix": "glfw-d3317b49373ced81a458008316dd5b6115d26df8",
230+
"strip_prefix": "glfw-19543afbfb3856e5ef7d5954ad795e1077e82550",
231231
"type": "tar.gz",
232232
"patches": [],
233233
"patch_tool": "",
@@ -245,7 +245,7 @@ resolved = [
245245
"tag": "",
246246
"name": "glfw",
247247
},
248-
"output_tree_hash": "a44caf5df5fe2d060e86988112e45161c0dc141056570e91d7f692097391288f",
248+
"output_tree_hash": "aa4553b4aa77802e88433412d94f2e14978416a65a2c25ff62c8a45e4cc4fd93",
249249
},
250250
],
251251
},
@@ -264,13 +264,13 @@ resolved = [
264264
"rule_class": "@bazel_upgradable//:rule.bzl%upgradable_repository",
265265
"attributes": {
266266
"urls": [
267-
"https://github.com/glfw/glfw/releases/download/3.3.4/glfw-3.3.4.bin.MACOS.zip",
267+
"https://github.com/glfw/glfw/releases/download/3.3.5/glfw-3.3.5.bin.MACOS.zip",
268268
],
269-
"sha256": "05acdcbbc1f69ac425cc6fa09cc13f1d21993a29cbdebb09f413c2f99358785c",
269+
"sha256": "184f165464ed9c46effd96c9fb6e355996d62f5f96f5e90542f00775fe781511",
270270
"netrc": "",
271271
"auth_patterns": {},
272272
"canonical_id": "",
273-
"strip_prefix": "glfw-3.3.4.bin.MACOS",
273+
"strip_prefix": "glfw-3.3.5.bin.MACOS",
274274
"type": "zip",
275275
"patches": [],
276276
"patch_tool": "",
@@ -288,7 +288,7 @@ resolved = [
288288
"tag": "~3",
289289
"name": "glfw_osx",
290290
},
291-
"output_tree_hash": "f1b4276aef9a555c6da8916e891083ff3de54e8e340b8ab896e751ca47a8f6d9",
291+
"output_tree_hash": "8bfd001632546166c2d147f2921c40a105029eef8d05166ddce756a01174e125",
292292
},
293293
],
294294
},
@@ -345,13 +345,13 @@ resolved = [
345345
"rule_class": "@bazel_upgradable//:rule.bzl%upgradable_repository",
346346
"attributes": {
347347
"urls": [
348-
"https://github.com/KhronosGroup/OpenGL-Registry/archive/6eca3c2cdc3d1a1147302052e1f1f61cc487b79b.tar.gz",
348+
"https://github.com/KhronosGroup/OpenGL-Registry/archive/b7532263e5a6bb505413786fa4926f4f0f010514.tar.gz",
349349
],
350-
"sha256": "73f342d9b2e50f91237bddca9c6e06b5fa8d99607337c169266cecbe0f884dce",
350+
"sha256": "92fbdfb27e59269c092861c94fc14b198c644a83a6ff21118a9b8bdb2d186f10",
351351
"netrc": "",
352352
"auth_patterns": {},
353353
"canonical_id": "",
354-
"strip_prefix": "OpenGL-Registry-6eca3c2cdc3d1a1147302052e1f1f61cc487b79b",
354+
"strip_prefix": "OpenGL-Registry-b7532263e5a6bb505413786fa4926f4f0f010514",
355355
"type": "tar.gz",
356356
"patches": [],
357357
"patch_tool": "",
@@ -369,7 +369,7 @@ resolved = [
369369
"tag": "",
370370
"name": "khronos_opengl_registry",
371371
},
372-
"output_tree_hash": "f4a107a39ff68b52867d95b74ce3698766d8debfc875135f3ccd51098f909089",
372+
"output_tree_hash": "00e357d6bac3a210b1c0e570c898cd98548f36d3afc0f15679a7c10716095e82",
373373
},
374374
],
375375
},
@@ -385,14 +385,14 @@ resolved = [
385385
"rule_class": "@bazel_upgradable//:rule.bzl%upgradable_repository",
386386
"attributes": {
387387
"urls": [
388-
"https://github.com/bazelbuild/rules_cc/archive/d66a13e2a01630afcafc4ba411d83e291ecf02bd.tar.gz",
389-
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/d66a13e2a01630afcafc4ba411d83e291ecf02bd.tar.gz",
388+
"https://github.com/bazelbuild/rules_cc/archive/f84656686987ce254481cc33efa3b6645d4254c3.tar.gz",
389+
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/f84656686987ce254481cc33efa3b6645d4254c3.tar.gz",
390390
],
391-
"sha256": "3cde212ccda3ba152897e7fd354c42eba275878b6d98fe4f2125c684a73f3842",
391+
"sha256": "a30681f34021a77638b07abcea132d0057aa16d81e76444b4c454c29ae59fac0",
392392
"netrc": "",
393393
"auth_patterns": {},
394394
"canonical_id": "",
395-
"strip_prefix": "rules_cc-d66a13e2a01630afcafc4ba411d83e291ecf02bd",
395+
"strip_prefix": "rules_cc-f84656686987ce254481cc33efa3b6645d4254c3",
396396
"type": "tar.gz",
397397
"patches": [],
398398
"patch_tool": "",
@@ -409,7 +409,7 @@ resolved = [
409409
"tag": "",
410410
"name": "rules_cc",
411411
},
412-
"output_tree_hash": "579c5eed391e6c1e02f4f450b9d99bdc8b86f1a6913b10389e4dbed7ccace6a1",
412+
"output_tree_hash": "400ca6f1331142b6c9922db519cf33d899f9f0c2acd262ac4585d444bf1d0adb",
413413
},
414414
],
415415
},

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: voidstar
2-
version: v1.34.0 # FIXME: 'git'
2+
version: v1.34.1 # FIXME: 'git'
33
summary: void* casts files onto 2D/3D colored spaces for your mind blowing needs # 79 char long summary
44
description: |
55
Usage:

voidstar/managers/manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class Manager {
6767
const offset_t woffset = static_cast<offset_t>(sliding_window_offset_);
6868
const offset_t wlength = static_cast<offset_t>(sliding_window_length_);
6969
auto left = indices.begin() + woffset;
70-
if (left < indices.begin()) left = indices.begin();
7170
if (left > indices.end()) left = indices.end() - woffset;
71+
if (left < indices.begin()) left = indices.begin();
7272
auto right = std::min(indices.end(), left + wlength);
7373
if (sliding_window_left_ != &left[0] ||
7474
sliding_window_right_ != &right[0]) {

voidstar/size2str.cc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
#include <cmath>
2-
31
#include "voidstar/size2str.h"
42

3+
#include <cmath>
4+
55
/// 991337 --> "991,337"
66
std::string size2str(size_t size) {
77
const auto digits = std::ceil(std::log10(size));
8-
const auto nonits = static_cast<size_t>(std::ceil(digits / 3) -1);
9-
std::string str(static_cast<size_t>(digits)+nonits, '*');
8+
const auto nonits = static_cast<size_t>(std::ceil(digits / 3) - 1);
9+
std::string str(static_cast<size_t>(digits) + nonits, '*');
1010

1111
int written = 0;
12-
for (size_t pos = str.length()-1; pos!=0; pos--) {
12+
for (size_t pos = str.length() - 1; pos != 0; pos--) {
1313
if (written != 0 && written % 3 == 0) {
1414
str[pos] = '_';
1515
written = 0;
1616
continue;
1717
}
18-
str[pos] = static_cast<char>('0' + size%10);
18+
str[pos] = static_cast<char>('0' + size % 10);
1919
size /= 10;
2020
written++;
2121
}
22-
if (size != 0)
23-
str[0] = static_cast<char>('0' + size);
22+
if (size != 0) str[0] = static_cast<char>('0' + size);
2423
return str;
2524
}

0 commit comments

Comments
 (0)