-
Notifications
You must be signed in to change notification settings - Fork 1k
panic: runtime error: slice bounds out of range #1209
Comments
It looks like an assumption that |
If I run
The leading "SSH..." is a reminder to myself that I will need to activate my U2F token. |
What is the output if you pass the repo explicitly? Can you elaborate on how you set the |
I was hit by this today as well, I added some debug output to the top of the listVersions loop to see the lines that it tried to parse, and the cause seems to be a warning from git that causes my panic: goroutine 50 [running]: it turned out I had a bad "credential.helper" field set in my git config which was the cause of it. |
@jmank88 Output of
|
I'm not sure of the best way to handle these cases. A dirty solution would be to ignore anything that doesn't look like a commit id (at least don't panic!). Is there a git flag to suppress output we don't want? |
I think dep is handling this wrong, it parses everything on stderr and stdout, but the git references are only written to stdout, everything on stderr is usually warnings related. Eiriks-MacBook-Pro:virtual-sensor eirik$ git ls-remote git@github.com:nyarly/versiontool.git 2>/dev/null dep should only parse stdout, stderr could be forwarded to the users stderr to show the messages, but dep shold not care about them. |
yeah, it's probably preferable in this case to just grab stdout, not stderr. now, it's not mutually exclusive, but we really ought to just to improve this parser in general - there's no reason we shouldn't be able to just discard lines that don't fit with valid patterns. i outlined what improved parsing logic would look like over in #1160 (comment) . |
Is there any risk in implicitly assuming that a line which parses is legitimate? It seems unlikely that it would happen on accident (given the strict format), but who knows what people are injecting. |
@jmank88 i don't think so. even if we're reading both stdout and stderr, i think the attack vector there requires placing a compromised git binary onto a user's system, then using it to inject output into compromising the server side, or a MITM, is a tad more interesting. but even then, git's doing integrity checks all the way up and down via its Merkle DAG. if incorrect revs are reported, we're going to know. the only real "attack" there that i can see being possible is pointing a ref to a rev with compromised code in it - but that's now out of the domain of |
Confirm. Run into it with |
Hi, we have stumbled upon this error because an empty
The line Creating an invalid public-key file in your |
panic: runtime error: slice bounds out of range this is the painc i am facing while connecting to mysql database in golang program |
This seems to be the same as #171, but based on the most recent release.
What version of
dep
are you using (dep version
)?v0.3.1
What
dep
command did you run?dep init
What did you expect to see?
Not that - I've never used dep on one of my own projects before, but roughly "dependencies resolved!" or something like.
What did you see instead?
The above panic.
The text was updated successfully, but these errors were encountered: