Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop in text.Wrap() if input is lacking spaces #1

Closed
011010101101 opened this issue Jan 11, 2014 · 1 comment
Closed

Infinite loop in text.Wrap() if input is lacking spaces #1

011010101101 opened this issue Jan 11, 2014 · 1 comment

Comments

@011010101101
Copy link

When calling text.Wrap(), if the input string:

  1. has no spaces, and
  2. is longer than the wrap size,
    then the function will loop forever and consume all available memory.

Sample program (be careful running this, it will consume all available memory):

package main

import (
    "github.com/kr/text"
)

func main() {
    text.Wrap("aaaaa", 4)
}
@aaudis
Copy link

aaudis commented Sep 4, 2015

I also need this issue to be fixed

Waiting, Thanks

@kr kr closed this as completed in bb797dc Sep 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants