aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-06-30 17:22:16 +0300
committerVeikka Tuominen <git@vexu.eu>2022-07-01 10:22:25 +0300
commitae7b32eb62cb00a09fe2e0e30b307eb83e9f0a86 (patch)
treeabe5edeef5d656feb5dcf82d5a8e93db67fd2afc /lib/std
parent3c73f711771e41e9176e973c64484f0ce5e0eeed (diff)
downloadzig-ae7b32eb62cb00a09fe2e0e30b307eb83e9f0a86.tar.gz
zig-ae7b32eb62cb00a09fe2e0e30b307eb83e9f0a86.zip
Sema: validate deref operator type and value
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/os.zig2
-rw-r--r--lib/std/process.zig2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 578a8ddcbc..02ed710dd3 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -1868,7 +1868,7 @@ pub fn getenv(key: []const u8) ?[]const u8 {
}
// Search the entire `environ` because we don't have a null terminated pointer.
var ptr = std.c.environ;
- while (ptr.*) |line| : (ptr += 1) {
+ while (ptr[0]) |line| : (ptr += 1) {
var line_i: usize = 0;
while (line[line_i] != 0 and line[line_i] != '=') : (line_i += 1) {}
const this_key = line[0..line_i];
diff --git a/lib/std/process.zig b/lib/std/process.zig
index 0b64b5910d..dffd6b1701 100644
--- a/lib/std/process.zig
+++ b/lib/std/process.zig
@@ -313,7 +313,7 @@ pub fn getEnvMap(allocator: Allocator) !EnvMap {
return result;
} else if (builtin.link_libc) {
var ptr = std.c.environ;
- while (ptr.*) |line| : (ptr += 1) {
+ while (ptr[0]) |line| : (ptr += 1) {
var line_i: usize = 0;
while (line[line_i] != 0 and line[line_i] != '=') : (line_i += 1) {}
const key = line[0..line_i];