Skip to content

Commit b281434

Browse files
authored
Merge pull request #89 from robinst/jv-stop-using-tainted-strings
Stop using tainted Ruby strings
2 parents fc49ec9 + 80227b5 commit b281434

File tree

13 files changed

+49
-49
lines changed

13 files changed

+49
-49
lines changed

ext/taglib_aiff/taglib_aiff_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
18911891
if (byteVector.isNull()) {
18921892
return Qnil;
18931893
} else {
1894-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1894+
return rb_str_new(byteVector.data(), byteVector.size());
18951895
}
18961896
}
18971897

@@ -1907,7 +1907,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19071907
if (string.isNull()) {
19081908
return Qnil;
19091909
} else {
1910-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1910+
VALUE result = rb_str_new2(string.toCString(true));
19111911
ASSOCIATE_UTF8_ENCODING(result);
19121912
return result;
19131913
}
@@ -1947,9 +1947,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19471947
VALUE result;
19481948
#ifdef _WIN32
19491949
const char *s = (const char *) filename;
1950-
result = rb_tainted_str_new2(s);
1950+
result = rb_str_new2(s);
19511951
#else
1952-
result = rb_tainted_str_new2(filename);
1952+
result = rb_str_new2(filename);
19531953
#endif
19541954
ASSOCIATE_FILESYSTEM_ENCODING(result);
19551955
return result;

ext/taglib_base/includes.i

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
3636
if (byteVector.isNull()) {
3737
return Qnil;
3838
} else {
39-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
39+
return rb_str_new(byteVector.data(), byteVector.size());
4040
}
4141
}
4242

@@ -52,7 +52,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
5252
if (string.isNull()) {
5353
return Qnil;
5454
} else {
55-
VALUE result = rb_tainted_str_new2(string.toCString(true));
55+
VALUE result = rb_str_new2(string.toCString(true));
5656
ASSOCIATE_UTF8_ENCODING(result);
5757
return result;
5858
}
@@ -92,9 +92,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
9292
VALUE result;
9393
#ifdef _WIN32
9494
const char *s = (const char *) filename;
95-
result = rb_tainted_str_new2(s);
95+
result = rb_str_new2(s);
9696
#else
97-
result = rb_tainted_str_new2(filename);
97+
result = rb_str_new2(filename);
9898
#endif
9999
ASSOCIATE_FILESYSTEM_ENCODING(result);
100100
return result;

ext/taglib_base/taglib_base_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
18941894
if (byteVector.isNull()) {
18951895
return Qnil;
18961896
} else {
1897-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1897+
return rb_str_new(byteVector.data(), byteVector.size());
18981898
}
18991899
}
19001900

@@ -1910,7 +1910,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19101910
if (string.isNull()) {
19111911
return Qnil;
19121912
} else {
1913-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1913+
VALUE result = rb_str_new2(string.toCString(true));
19141914
ASSOCIATE_UTF8_ENCODING(result);
19151915
return result;
19161916
}
@@ -1950,9 +1950,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19501950
VALUE result;
19511951
#ifdef _WIN32
19521952
const char *s = (const char *) filename;
1953-
result = rb_tainted_str_new2(s);
1953+
result = rb_str_new2(s);
19541954
#else
1955-
result = rb_tainted_str_new2(filename);
1955+
result = rb_str_new2(filename);
19561956
#endif
19571957
ASSOCIATE_FILESYSTEM_ENCODING(result);
19581958
return result;

ext/taglib_flac/taglib_flac_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
19001900
if (byteVector.isNull()) {
19011901
return Qnil;
19021902
} else {
1903-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1903+
return rb_str_new(byteVector.data(), byteVector.size());
19041904
}
19051905
}
19061906

@@ -1916,7 +1916,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19161916
if (string.isNull()) {
19171917
return Qnil;
19181918
} else {
1919-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1919+
VALUE result = rb_str_new2(string.toCString(true));
19201920
ASSOCIATE_UTF8_ENCODING(result);
19211921
return result;
19221922
}
@@ -1956,9 +1956,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19561956
VALUE result;
19571957
#ifdef _WIN32
19581958
const char *s = (const char *) filename;
1959-
result = rb_tainted_str_new2(s);
1959+
result = rb_str_new2(s);
19601960
#else
1961-
result = rb_tainted_str_new2(filename);
1961+
result = rb_str_new2(filename);
19621962
#endif
19631963
ASSOCIATE_FILESYSTEM_ENCODING(result);
19641964
return result;

ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
18851885
if (byteVector.isNull()) {
18861886
return Qnil;
18871887
} else {
1888-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1888+
return rb_str_new(byteVector.data(), byteVector.size());
18891889
}
18901890
}
18911891

@@ -1901,7 +1901,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19011901
if (string.isNull()) {
19021902
return Qnil;
19031903
} else {
1904-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1904+
VALUE result = rb_str_new2(string.toCString(true));
19051905
ASSOCIATE_UTF8_ENCODING(result);
19061906
return result;
19071907
}
@@ -1941,9 +1941,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19411941
VALUE result;
19421942
#ifdef _WIN32
19431943
const char *s = (const char *) filename;
1944-
result = rb_tainted_str_new2(s);
1944+
result = rb_str_new2(s);
19451945
#else
1946-
result = rb_tainted_str_new2(filename);
1946+
result = rb_str_new2(filename);
19471947
#endif
19481948
ASSOCIATE_FILESYSTEM_ENCODING(result);
19491949
return result;

ext/taglib_id3v1/taglib_id3v1_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
18871887
if (byteVector.isNull()) {
18881888
return Qnil;
18891889
} else {
1890-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1890+
return rb_str_new(byteVector.data(), byteVector.size());
18911891
}
18921892
}
18931893

@@ -1903,7 +1903,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19031903
if (string.isNull()) {
19041904
return Qnil;
19051905
} else {
1906-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1906+
VALUE result = rb_str_new2(string.toCString(true));
19071907
ASSOCIATE_UTF8_ENCODING(result);
19081908
return result;
19091909
}
@@ -1943,9 +1943,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19431943
VALUE result;
19441944
#ifdef _WIN32
19451945
const char *s = (const char *) filename;
1946-
result = rb_tainted_str_new2(s);
1946+
result = rb_str_new2(s);
19471947
#else
1948-
result = rb_tainted_str_new2(filename);
1948+
result = rb_str_new2(filename);
19491949
#endif
19501950
ASSOCIATE_FILESYSTEM_ENCODING(result);
19511951
return result;

ext/taglib_id3v2/taglib_id3v2_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
19231923
if (byteVector.isNull()) {
19241924
return Qnil;
19251925
} else {
1926-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1926+
return rb_str_new(byteVector.data(), byteVector.size());
19271927
}
19281928
}
19291929

@@ -1939,7 +1939,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19391939
if (string.isNull()) {
19401940
return Qnil;
19411941
} else {
1942-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1942+
VALUE result = rb_str_new2(string.toCString(true));
19431943
ASSOCIATE_UTF8_ENCODING(result);
19441944
return result;
19451945
}
@@ -1979,9 +1979,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19791979
VALUE result;
19801980
#ifdef _WIN32
19811981
const char *s = (const char *) filename;
1982-
result = rb_tainted_str_new2(s);
1982+
result = rb_str_new2(s);
19831983
#else
1984-
result = rb_tainted_str_new2(filename);
1984+
result = rb_str_new2(filename);
19851985
#endif
19861986
ASSOCIATE_FILESYSTEM_ENCODING(result);
19871987
return result;

ext/taglib_mp4/taglib_mp4_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
19031903
if (byteVector.isNull()) {
19041904
return Qnil;
19051905
} else {
1906-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1906+
return rb_str_new(byteVector.data(), byteVector.size());
19071907
}
19081908
}
19091909

@@ -1919,7 +1919,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19191919
if (string.isNull()) {
19201920
return Qnil;
19211921
} else {
1922-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1922+
VALUE result = rb_str_new2(string.toCString(true));
19231923
ASSOCIATE_UTF8_ENCODING(result);
19241924
return result;
19251925
}
@@ -1959,9 +1959,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19591959
VALUE result;
19601960
#ifdef _WIN32
19611961
const char *s = (const char *) filename;
1962-
result = rb_tainted_str_new2(s);
1962+
result = rb_str_new2(s);
19631963
#else
1964-
result = rb_tainted_str_new2(filename);
1964+
result = rb_str_new2(filename);
19651965
#endif
19661966
ASSOCIATE_FILESYSTEM_ENCODING(result);
19671967
return result;

ext/taglib_mpeg/taglib_mpeg_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
19001900
if (byteVector.isNull()) {
19011901
return Qnil;
19021902
} else {
1903-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1903+
return rb_str_new(byteVector.data(), byteVector.size());
19041904
}
19051905
}
19061906

@@ -1916,7 +1916,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19161916
if (string.isNull()) {
19171917
return Qnil;
19181918
} else {
1919-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1919+
VALUE result = rb_str_new2(string.toCString(true));
19201920
ASSOCIATE_UTF8_ENCODING(result);
19211921
return result;
19221922
}
@@ -1956,9 +1956,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19561956
VALUE result;
19571957
#ifdef _WIN32
19581958
const char *s = (const char *) filename;
1959-
result = rb_tainted_str_new2(s);
1959+
result = rb_str_new2(s);
19601960
#else
1961-
result = rb_tainted_str_new2(filename);
1961+
result = rb_str_new2(filename);
19621962
#endif
19631963
ASSOCIATE_FILESYSTEM_ENCODING(result);
19641964
return result;

ext/taglib_ogg/taglib_ogg_wrap.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
18941894
if (byteVector.isNull()) {
18951895
return Qnil;
18961896
} else {
1897-
return rb_tainted_str_new(byteVector.data(), byteVector.size());
1897+
return rb_str_new(byteVector.data(), byteVector.size());
18981898
}
18991899
}
19001900

@@ -1910,7 +1910,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
19101910
if (string.isNull()) {
19111911
return Qnil;
19121912
} else {
1913-
VALUE result = rb_tainted_str_new2(string.toCString(true));
1913+
VALUE result = rb_str_new2(string.toCString(true));
19141914
ASSOCIATE_UTF8_ENCODING(result);
19151915
return result;
19161916
}
@@ -1950,9 +1950,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
19501950
VALUE result;
19511951
#ifdef _WIN32
19521952
const char *s = (const char *) filename;
1953-
result = rb_tainted_str_new2(s);
1953+
result = rb_str_new2(s);
19541954
#else
1955-
result = rb_tainted_str_new2(filename);
1955+
result = rb_str_new2(filename);
19561956
#endif
19571957
ASSOCIATE_FILESYSTEM_ENCODING(result);
19581958
return result;

0 commit comments

Comments
 (0)