Skip to content

Commit

Permalink
Fix code scanning alert no. 6: Log entries created from user input
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
praseodym and github-advanced-security[bot] authored Dec 12, 2024
1 parent 5af1f35 commit f8b89f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion link.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ func deleteLinkController(a *App) gin.HandlerFunc {
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{
"errorMessage": fmt.Sprintf("Unable to delete link, error: %s", err),
})
log.Errorf("unable to delete link with name=%s, error: %s", name, err)
sanitizedName := strings.ReplaceAll(name, "\n", "")
sanitizedName = strings.ReplaceAll(sanitizedName, "\r", "")
log.Errorf("unable to delete link with name=%s, error: %s", sanitizedName, err)
return
}

Expand Down

0 comments on commit f8b89f3

Please sign in to comment.