]> Cypherpunks repositories - gostls13.git/commitdiff
Continuation of issue 221 fix. When 8g or 6g or 5g are called with a
authorCharles L. Dorian <cldorian@gmail.com>
Wed, 9 Dec 2009 19:56:45 +0000 (11:56 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 9 Dec 2009 19:56:45 +0000 (11:56 -0800)
UTF-8 string, Yconv() converts it into an octal sequence. If the
string converted to more than 30 bytes, the str buffer would
overflow. For example, 4 Greek runes became 32 bytes, 3 Hiragana
runes became 36 bytes, and 2 Gothic runes became 32 bytes. In
8l, 6l and 5l the function is Sconv(). For some reason, only 5l uses
the constant STRINGSZ (defined as 200) for the buffer size.

R=rsc
https://golang.org/cl/168045

src/cmd/5g/list.c
src/cmd/6c/list.c
src/cmd/6g/list.c
src/cmd/8c/list.c
src/cmd/8g/list.c

index d0febaca6d65625377c446473cf912e57caabc03..dfe3bcb79cf38e1a0a6d674926dc34900e37eedb 100644 (file)
@@ -233,7 +233,7 @@ int
 Yconv(Fmt *fp)
 {
        int i, c;
-       char str[30], *p, *a;
+       char str[100], *p, *a;
 
        a = va_arg(fp->args, char*);
        p = str;
index e3a0ea81b42fac89c14fcecb2ce9de9fba45551a..64afe79fe49cddc40fbcba7c1ac00ddd40fa36ec 100644 (file)
@@ -353,7 +353,7 @@ int
 Sconv(Fmt *fp)
 {
        int i, c;
-       char str[30], *p, *a;
+       char str[100], *p, *a;
 
        a = va_arg(fp->args, char*);
        p = str;
index 41956e63caf5d741f604fe82ba5f15c551def26b..eadd7481bc2644a5cfb26e9971a886a0f249d225 100644 (file)
@@ -313,7 +313,7 @@ int
 Yconv(Fmt *fp)
 {
        int i, c;
-       char str[30], *p, *a;
+       char str[100], *p, *a;
 
        a = va_arg(fp->args, char*);
        p = str;
index c2ce5b2951243c093686b2b3de0295ca318b85a1..3edaa2e1fba1c7134109f85d77878301a0c6676e 100644 (file)
@@ -274,7 +274,7 @@ int
 Sconv(Fmt *fp)
 {
        int i, c;
-       char str[30], *p, *a;
+       char str[100], *p, *a;
 
        a = va_arg(fp->args, char*);
        p = str;
index f94b9e1766ab440cf7bb42ff1dd31f6c2c11d496..2a7dc277fd53e82c72577f4e251d7cce5bbc9e79 100644 (file)
@@ -256,7 +256,7 @@ int
 Yconv(Fmt *fp)
 {
        int i, c;
-       char str[30], *p, *a;
+       char str[100], *p, *a;
 
        a = va_arg(fp->args, char*);
        p = str;