You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2017/12/08 23:07:29 UTC

[GitHub] mkiiskila closed pull request #116: newt; fix crash when using invalid repo name in package name.

mkiiskila closed pull request #116: newt; fix crash when using invalid repo name in package name.
URL: https://github.com/apache/mynewt-newt/pull/116
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/newt/project/project.go b/newt/project/project.go
index f26c97a..69569d2 100644
--- a/newt/project/project.go
+++ b/newt/project/project.go
@@ -633,10 +633,12 @@ func (proj *Project) ResolvePackage(
 	var repo interfaces.RepoInterface
 	if repoName == "" {
 		repo = dfltRepo
-	} else {
+	} else if proj.repos[repoName] != nil {
 		repo = proj.repos[repoName]
+	} else {
+		return nil, util.FmtNewtError("invalid package name: %s (unkwn repo %s)",
+			name, repoName)
 	}
-
 	dep, err := pkg.NewDependency(repo, pkgName)
 	if err != nil {
 		return nil, util.FmtNewtError("invalid package name: %s (%s)", name,


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services