Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/databases/db5/files/patch-lang_tcl_tcl__env.c
16461 views
1
--- lang/tcl/tcl_env.c.orig 2013-09-09 15:35:07 UTC
2
+++ lang/tcl/tcl_env.c
3
@@ -2864,9 +2864,10 @@ env_GetFlags(interp, objc, objv, dbenv)
4
for (i = 0; open_flags[i].flag != 0; i++)
5
if (LF_ISSET(open_flags[i].flag)) {
6
if (strlen(buf) > 0)
7
- (void)strncat(buf, " ", sizeof(buf));
8
- (void)strncat(
9
- buf, open_flags[i].arg, sizeof(buf));
10
+ (void)strncat(buf, " ",
11
+ sizeof(buf) - (strlen(buf) + 1));
12
+ (void)strncat(buf, open_flags[i].arg,
13
+ sizeof(buf) - (strlen(buf) + 1));
14
}
15
16
res = NewStringObj(buf, strlen(buf));
17
@@ -2930,9 +2931,10 @@ env_GetOpenFlag(interp, objc, objv, dben
18
for (i = 0; open_flags[i].flag != 0; i++)
19
if (LF_ISSET(open_flags[i].flag)) {
20
if (strlen(buf) > 0)
21
- (void)strncat(buf, " ", sizeof(buf));
22
- (void)strncat(
23
- buf, open_flags[i].arg, sizeof(buf));
24
+ (void)strncat(buf, " ",
25
+ sizeof(buf) - (strlen(buf) + 1));
26
+ (void)strncat(buf, open_flags[i].arg,
27
+ sizeof(buf) - (strlen(buf) + 1));
28
}
29
30
res = NewStringObj(buf, strlen(buf));
31
@@ -2982,9 +2984,10 @@ tcl_EnvGetEncryptFlags(interp, objc, obj
32
for (i = 0; encrypt_flags[i].flag != 0; i++)
33
if (LF_ISSET(encrypt_flags[i].flag)) {
34
if (strlen(buf) > 0)
35
- (void)strncat(buf, " ", sizeof(buf));
36
- (void)strncat(
37
- buf, encrypt_flags[i].arg, sizeof(buf));
38
+ (void)strncat(buf, " ",
39
+ sizeof(buf) - (strlen(buf) + 1));
40
+ (void)strncat(buf, encrypt_flags[i].arg,
41
+ sizeof(buf) - (strlen(buf) + 1));
42
}
43
44
res = NewStringObj(buf, strlen(buf));
45
46