[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] GUI problems with 3.7
From: |
Sylvain Munaut |
Subject: |
Re: [Discuss-gnuradio] GUI problems with 3.7 |
Date: |
Sat, 22 Jun 2013 10:50:12 +0200 |
> In this case, I /know/ that string
> b is properly terminated (because I wrote it into the code). So I use
> the length of b to compare with a and l = strlen(b). There are other
> ways, too, but this was the most unobtrusive way to handle this case.
Huh ... but strcmp will stop comparing at the end of any of the two
strings anyway.
So I don't see how this: (
https://github.com/gnuradio/gnuradio/commit/c1e91f0200a58a6cb24d1de9422f1a6e2483fc2c
)
- if (strcmp (name, all[i]->name ()) == 0){
+ if (strncmp (name, all[i]->name(), strlen(all[i]->name())) == 0){
would provide any more safety again "bad" user strings.
The only difference this code will make is that now "all[i]->name()"
only needs to be a _prefix_ to "name" rather than a full length match.
(which may very well fix the original issue but doesn't do much about
"unsafe non null terminated strings")
Cheers,
Sylvain
- [Discuss-gnuradio] GUI problems with 3.7, Tom Rondeau, 2013/06/21
- Re: [Discuss-gnuradio] GUI problems with 3.7, Marcus D. Leech, 2013/06/21
- Re: [Discuss-gnuradio] GUI problems with 3.7, Tom Rondeau, 2013/06/21
- Re: [Discuss-gnuradio] GUI problems with 3.7, Nathan West, 2013/06/21
- Re: [Discuss-gnuradio] GUI problems with 3.7, Marcus D. Leech, 2013/06/21
- Re: [Discuss-gnuradio] GUI problems with 3.7, Tom Rondeau, 2013/06/21
- Re: [Discuss-gnuradio] GUI problems with 3.7,
Sylvain Munaut <=
- Re: [Discuss-gnuradio] GUI problems with 3.7, Tom Rondeau, 2013/06/22
- Re: [Discuss-gnuradio] GUI problems with 3.7, Sylvain Munaut, 2013/06/22
- Re: [Discuss-gnuradio] GUI problems with 3.7, Tom Rondeau, 2013/06/22