Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
50bd5c11
Kaydet (Commit)
50bd5c11
authored
Kas 29, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
wsprintf is broken by design and never writes more than 1024 characters
Change-Id: I791e55bb5d98ee82c01271dcebafa7c4672cd424
üst
99d3733c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
python.cxx
pyuno/zipcore/python.cxx
+17
-15
No files found.
pyuno/zipcore/python.cxx
Dosyayı görüntüle @
50bd5c11
...
...
@@ -192,10 +192,12 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
exit
(
EXIT_FAILURE
);
}
}
wchar_t
*
value
=
new
wchar_t
[
(
urepathEnd
-
urepath
)
+
MY_LENGTH
(
L";"
)
+
(
pathEnd
-
path
)
+
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
];
//TODO: overflow
wsprintfW
(
value
,
L"%s;%s%s%s"
,
urepath
,
path
,
n
==
0
?
L""
:
L";"
,
orig
);
std
::
size_t
len
=
(
urepathEnd
-
urepath
)
+
MY_LENGTH
(
L";"
)
+
(
pathEnd
-
path
)
+
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
;
//TODO: overflow
wchar_t
*
value
=
new
wchar_t
[
len
];
_snwprintf
(
value
,
len
,
L"%s;%s%s%s"
,
urepath
,
path
,
n
==
0
?
L""
:
L";"
,
orig
);
if
(
!
SetEnvironmentVariableW
(
L"PATH"
,
value
))
{
exit
(
EXIT_FAILURE
);
}
...
...
@@ -218,21 +220,21 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
}
}
#ifdef __MINGW32__
value
=
new
wchar_t
[
(
pathEnd
-
path
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath2End
-
pythonpath2
)
+
len
=
(
pathEnd
-
path
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath2End
-
pythonpath2
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath4End
-
pythonpath4
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath3End
-
pythonpath3
)
+
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
];
//TODO: overflow
wsprintfW
(
value
,
L"%s;%s;%s;%s%s%s"
,
path
,
pythonpath2
,
pythonpath4
,
pythonpath3
,
n
==
0
?
L""
:
L";"
,
orig
);
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
;
//TODO: overflow
value
=
new
wchar_t
[
len
];
_snwprintf
(
value
,
len
,
L"%s;%s;%s;%s%s%s"
,
path
,
pythonpath2
,
pythonpath4
,
pythonpath3
,
n
==
0
?
L""
:
L";"
,
orig
);
#else
value
=
new
wchar_t
[
(
pathEnd
-
path
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath2End
-
pythonpath2
)
+
len
=
(
pathEnd
-
path
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath2End
-
pythonpath2
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath3End
-
pythonpath3
)
+
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
];
//TODO: overflow
wsprintfW
(
value
,
L"%s;%s;%s%s%s"
,
path
,
pythonpath2
,
pythonpath3
,
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
;
//TODO: overflow
value
=
new
wchar_t
[
len
];
_snwprintf
(
value
,
len
,
L"%s;%s;%s%s%s"
,
path
,
pythonpath2
,
pythonpath3
,
n
==
0
?
L""
:
L";"
,
orig
);
#endif
if
(
!
SetEnvironmentVariableW
(
L"PYTHONPATH"
,
value
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment