Skip to content

Commit

Permalink
Add sanity check for GUIDs in SupportedOS directives (#30)
Browse files Browse the repository at this point in the history
Thanks go to @jpbro for reporting the issue
  • Loading branch information
wqweto committed Nov 4, 2021
1 parent 603d0c6 commit f00d151
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here is a sample ini file for the sample solution above:
Dependency ClrComponent.dll /u
Dependency ComCtl

`Identity` command is needed to produce `assemblyIdentity` tag in the output manifest. The parameters of the command are `<exe_file>` and optional `[name]` and `[description]`. The path of the `<exe_file>` paramter sets the base path of the application, so that relative paths in next commands are based on this application path.
`Identity` command is needed to produce `assemblyIdentity` tag in the output manifest. The parameters of the command are `<exe_file>` and optional `[name]` and `[description]`. The path of the `<exe_file>` parameter sets the base path of the application, so that relative paths in next commands are based on this application path.

### Referencing COM components

Expand Down
8 changes: 4 additions & 4 deletions Src/Ummm.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ Path32=".."
Command32=""
Name="Ummm"
HelpContextID="0"
Description="Unattended MMM 1.0.15"
Description="Unattended MMM 1.0.16"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=15
RevisionVer=16
AutoIncrementVer=0
ServerSupportFiles=0
VersionComments="Unattended MMM"
VersionCompanyName="Unicontsoft"
VersionFileDescription="Unattended MMM 1.0.15"
VersionLegalCopyright="Copyright (c) 2009-2020 by [email protected]"
VersionFileDescription="Unattended MMM 1.0.16"
VersionLegalCopyright="Copyright (c) 2009-2021 by [email protected]"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
Expand Down
15 changes: 12 additions & 3 deletions Src/mdUmmm.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Attribute VB_Name = "mdUmmm"
'=========================================================================
'
' Unattended Make My Manifest Project
' Copyright (c) 2009-2020 [email protected]
' Copyright (c) 2009-2021 [email protected]
'
'=========================================================================
Option Explicit
Expand Down Expand Up @@ -614,8 +614,11 @@ Private Function pvDumpSupportedOs(vRow As Variant, cOutput As Collection) As Bo
Case "win10"
sGuid = "{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"
Case Else
'--- this has to be properly escaped attribute value
sGuid = At(vRow, lIdx)
If pvIsGuid(At(vRow, lIdx)) Then
sGuid = At(vRow, lIdx)
Else
sGuid = vbNullString
End If
End Select
If LenB(sGuid) <> 0 Then
cOutput.Add Printf(" <supportedOS Id=""%1"" />", sGuid)
Expand Down Expand Up @@ -957,3 +960,9 @@ Private Function pvGetProgID(sClsID As String) As String
Call CoTaskMemFree(lPtr)
End If
End Function

Private Function pvIsGuid(ByVal sValue As String) As Boolean
Const EMPTY_GUID As String = "{00000000-0000-0000-0000-000000000000}"
pvIsGuid = sValue Like Replace(EMPTY_GUID, "0", "[0-9a-fA-F]")
End Function

0 comments on commit f00d151

Please sign in to comment.