Skip to content

Fix unintentional recursion (i.e. stack overflow)#5578

Merged
valadas merged 2 commits intodnnsoftware:developfrom
bdukes:fix-recursion-stack-overflow
Mar 16, 2023
Merged

Fix unintentional recursion (i.e. stack overflow)#5578
valadas merged 2 commits intodnnsoftware:developfrom
bdukes:fix-recursion-stack-overflow

Conversation

@bdukes
Copy link
Copy Markdown
Contributor

@bdukes bdukes commented Mar 15, 2023

The ModuleID property of URLTrackingControl references itself and so always loops forever whenever it's read.

Fixes #5577
Fixes DNNCommunity/DNN.Documents#22

@bdukes bdukes added this to the 9.11.2 milestone Mar 15, 2023
Copy link
Copy Markdown
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice refactoring but I am failing to figure out what the recursion problem was...

@bdukes
Copy link
Copy Markdown
Contributor Author

bdukes commented Mar 16, 2023

Sorry, the first commit has the fix, the others were just little things I saw as I checked some other controls nearby.

diff --git a/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs b/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs
index 6bc2e43a3ab..d3c84980fd5 100644
--- a/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs	
+++ b/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs	
@@ -125,7 +125,7 @@ public int ModuleID
         {
             get
             {
-                int moduleID = this.ModuleID;
+                int moduleID = this.moduleID;
                 if (moduleID == -2)
                 {
                     if (this.Request.QueryString["mid"] != null)

Copy link
Copy Markdown
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, thanks, makes perfect sense now

@valadas valadas merged commit 0ca5297 into dnnsoftware:develop Mar 16, 2023
@bdukes bdukes deleted the fix-recursion-stack-overflow branch March 28, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stack Overflow Exception when using URLTrackingControl Cannot edit document, clicking on edit pencil crashes website

3 participants