Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from OSGeo:master #160

Merged
merged 37 commits into from
Jan 17, 2025
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4457700
Add CPLFormFilenameSafe() and CPLFormFilenameCISafe()
rouault Jan 11, 2025
32df413
port/: use CPLFormFilenameSafe() wherever possible
rouault Jan 11, 2025
0cc942a
gcore/: use CPLFormFilenameSafe()
rouault Jan 11, 2025
543e974
Add CPLGetPathSafe(), CPLGetDirnameSafe(), CPLGetBasenameSafe(), CPLG…
rouault Jan 11, 2025
34d6cc1
port/: use CPLGetPathSafe(), CPLGetDirnameSafe(), CPLGetBasenameSafe(…
rouault Jan 11, 2025
b2985b2
cpl_vsi_mem.cpp: more uses of std::string instead of CPLString; sligh…
rouault Jan 11, 2025
3c7d8eb
GDALOpenInfo: add a osExtension member
rouault Jan 11, 2025
ba7d924
Add GDALOpenInfo::IsExtensionEqualToCI()
rouault Jan 11, 2025
7ae8663
frmts/, ogr/: replace 'EQUAL(CPLGetExtension(poOpenInfo->pszFilename)…
rouault Jan 11, 2025
1a6fa67
frmts/ ogr/: replace EQUAL(CPLGetExtension(...), ...) by EQUAL(CPLGet…
rouault Jan 11, 2025
0221c26
frmts/: manual replacement of last uses of CPLGetExtension() by CPLGe…
rouault Jan 11, 2025
e8ef18c
Add CPLResetExtensionSafe(), CPLProjectRelativeFilenameSafe(), CPLCle…
rouault Jan 12, 2025
0d80c3f
MBTiles: use of RFC105 safer path functions, to avoid issue with late…
rouault Jan 12, 2025
26cea5b
Automated use of RFC105 safe functions
rouault Jan 12, 2025
5e19395
Automated use of RFC105 safe functions
rouault Jan 12, 2025
94ca285
frmts/ ogr/ .cpp: replace all remaining uses of CPLGetBasename() with…
rouault Jan 13, 2025
cd20e27
frmts/ ogr/ .cpp: replace all remaining uses of CPLGetDirname() with …
rouault Jan 13, 2025
a498111
frmts/ ogr/ .cpp: replace all remaining uses of CPLGetPath() with CPL…
rouault Jan 13, 2025
2c17139
OpenFileGDB: remove obsole #ifdef FOR_FUSIL code paths
rouault Jan 13, 2025
71c919e
frmts/ ogr/ .cpp: replace all remaining uses of CPLGetExtension() wit…
rouault Jan 13, 2025
ac575e2
Automated use of RFC105 safe functions
rouault Jan 14, 2025
c95797a
Automated use of RFC105 safe functions
rouault Jan 14, 2025
bab3feb
frmts/ ogr/ .cpp: replace all remaining uses of CPLFormCIFilename() w…
rouault Jan 14, 2025
0ba23a9
frmts/ ogr/ .cpp: replace all remaining uses of CPLResetExtension() w…
rouault Jan 14, 2025
ef2b258
frmts/ ogr/ .cpp: replace all remaining uses of CPLProjectRelativeFil…
rouault Jan 14, 2025
70d8e75
frmts/ ogr/ .cpp: replace all remaining uses of CPLGenerateTempFilena…
rouault Jan 14, 2025
d795299
frmts/ ogr/ .cpp: replace all remaining uses of CPLFormFilename() wit…
rouault Jan 14, 2025
8125286
gnm: convert to safe path functions
rouault Jan 14, 2025
1acb5ca
port: convert to safe path functions
rouault Jan 14, 2025
f9e3c25
gcore: convert to safe path functions
rouault Jan 14, 2025
cc71e66
ogr: replace CPLExpandTilde() with CPLExpandTildeSafe()
rouault Jan 14, 2025
7b636ab
apps: convert to safe path functions
rouault Jan 14, 2025
887535a
Remove last remaining uses of 'unsafe' path functions from C++ code
rouault Jan 14, 2025
df669f9
Prevent using 'unsafe' path functions from GDAL C++ code
rouault Jan 14, 2025
99dc672
VSIArchiveFilesystemHandler::SplitFilename(): revet no longer need ha…
rouault Jan 15, 2025
48b704b
Merge pull request #11639 from rouault/CPLFormFilenameSafe
rouault Jan 17, 2025
3da6544
CI gdal-master conda: fix upload of packages
rouault Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MBTiles: use of RFC105 safer path functions, to avoid issue with late…
…r automation scripts
rouault committed Jan 13, 2025
commit 0d80c3f49d225647f70037b798014ed97b5032f7
13 changes: 7 additions & 6 deletions frmts/mbtiles/mbtilesdataset.cpp
Original file line number Diff line number Diff line change
@@ -3054,10 +3054,11 @@ bool MBTilesDataset::CreateInternal(const char *pszFilename, int nXSize,
return false;
}

const char *pszName =
CSLFetchNameValueDef(papszOptions, "NAME", CPLGetBasename(pszFilename));
const std::string osName = CSLFetchNameValueDef(
papszOptions, "NAME", CPLGetBasenameSafe(pszFilename).c_str());
char *pszSQL = sqlite3_mprintf(
"INSERT INTO metadata (name, value) VALUES ('name', '%q')", pszName);
"INSERT INTO metadata (name, value) VALUES ('name', '%q')",
osName.c_str());
sqlite3_exec(hDB, pszSQL, nullptr, nullptr, nullptr);
sqlite3_free(pszSQL);

@@ -3067,11 +3068,11 @@ bool MBTilesDataset::CreateInternal(const char *pszFilename, int nXSize,
sqlite3_exec(hDB, pszSQL, nullptr, nullptr, nullptr);
sqlite3_free(pszSQL);

const char *pszDescription = CSLFetchNameValueDef(
papszOptions, "DESCRIPTION", CPLGetBasename(pszFilename));
const std::string osDescription = CSLFetchNameValueDef(
papszOptions, "DESCRIPTION", CPLGetBasenameSafe(pszFilename).c_str());
pszSQL = sqlite3_mprintf(
"INSERT INTO metadata (name, value) VALUES ('description', '%q')",
pszDescription);
osDescription.c_str());
sqlite3_exec(hDB, pszSQL, nullptr, nullptr, nullptr);
sqlite3_free(pszSQL);