Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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ç
Batuhan Osman TASKAYA
cpython
Commits
d0278ec9
Kaydet (Commit)
d0278ec9
authored
Ara 12, 2004
tarafından
Andrew MacIntyre
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
OS/2 specific fixes related to SF bug # 1003471
üst
222d5b46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
getpathp.c
PC/os2emx/getpathp.c
+12
-1
getpathp.c
PC/os2vacpp/getpathp.c
+11
-0
No files found.
PC/os2emx/getpathp.c
Dosyayı görüntüle @
d0278ec9
...
...
@@ -132,7 +132,16 @@ ismodule(char *filename)
return
0
;
}
/* guarantees buffer will never overflow MAXPATHLEN+1 bytes */
/* Add a path component, by appending stuff to buffer.
buffer must have at least MAXPATHLEN + 1 bytes allocated, and contain a
NUL-terminated string with no more than MAXPATHLEN characters (not counting
the trailing NUL). It's a fatal error if it contains a string longer than
that (callers must be careful!). If these requirements are met, it's
guaranteed that buffer will still be a NUL-terminated string with no more
than MAXPATHLEN characters at exit. If stuff is too long, only as much of
stuff as fits will be appended.
*/
static
void
join
(
char
*
buffer
,
char
*
stuff
)
{
...
...
@@ -144,6 +153,8 @@ join(char *buffer, char *stuff)
if
(
n
>
0
&&
!
is_sep
(
buffer
[
n
-
1
])
&&
n
<
MAXPATHLEN
)
buffer
[
n
++
]
=
SEP
;
}
if
(
n
>
MAXPATHLEN
)
Py_FatalError
(
"buffer overflow in getpathp.c's joinpath()"
);
k
=
strlen
(
stuff
);
if
(
n
+
k
>
MAXPATHLEN
)
k
=
MAXPATHLEN
-
n
;
...
...
PC/os2vacpp/getpathp.c
Dosyayı görüntüle @
d0278ec9
...
...
@@ -83,6 +83,15 @@ exists(char *filename)
}
/* Add a path component, by appending stuff to buffer.
buffer must have at least MAXPATHLEN + 1 bytes allocated, and contain a
NUL-terminated string with no more than MAXPATHLEN characters (not counting
the trailing NUL). It's a fatal error if it contains a string longer than
that (callers must be careful!). If these requirements are met, it's
guaranteed that buffer will still be a NUL-terminated string with no more
than MAXPATHLEN characters at exit. If stuff is too long, only as much of
stuff as fits will be appended.
*/
static
void
join
(
char
*
buffer
,
char
*
stuff
)
{
...
...
@@ -94,6 +103,8 @@ join(char *buffer, char *stuff)
if
(
n
>
0
&&
!
is_sep
(
buffer
[
n
-
1
])
&&
n
<
MAXPATHLEN
)
buffer
[
n
++
]
=
SEP
;
}
if
(
n
>
MAXPATHLEN
)
Py_FatalError
(
"buffer overflow in getpathp.c's joinpath()"
);
k
=
strlen
(
stuff
);
if
(
n
+
k
>
MAXPATHLEN
)
k
=
MAXPATHLEN
-
n
;
...
...
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