aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-27 20:35:29 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-27 20:35:29 +0200
commitefce1eb17192f46bf01e77f244c76add3061f8f6 (patch)
treea89aebfbf65edca483705eb60c7c9a941334b848
parent04c4ec77155f9da75a9e5ec5a66a389317dede26 (diff)
downloaddabmux-efce1eb17192f46bf01e77f244c76add3061f8f6.tar.gz
dabmux-efce1eb17192f46bf01e77f244c76add3061f8f6.tar.bz2
dabmux-efce1eb17192f46bf01e77f244c76add3061f8f6.zip
Fix segmentation fault in short label check
-rw-r--r--src/MuxElements.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp
index e8871d1..ac6ee32 100644
--- a/src/MuxElements.cpp
+++ b/src/MuxElements.cpp
@@ -104,10 +104,10 @@ int DabLabel::setShortLabel(const std::string& slabel)
/* Iterate over the label and set the bits in the flag
* according to the characters in the slabel
*/
- for (int i = 0; i < 32; ++i) {
+ for (int i = 0; i < 16; ++i) {
if (*slab == this->m_text[i]) {
flag |= 0x8000 >> i;
- if (*(++slab) == 0) {
+ if (*(++slab) == '\0') {
break;
}
}