Permalink
Browse files

[service type] fixed another length constraint off-by-one-bug

  • Loading branch information...
1 parent 8a3ac95 commit cddb0df5fb88f20347771d6f6558583abcf77749 @agnat committed Dec 28, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/service_type.js
View
@@ -156,8 +156,8 @@ function checkLengthAndCharset(str) {
if (str.length === 0) {
throw new Error('type ' + str + ' must not be empty');
}
- if (str.length > 14) {
- throw new Error('type ' + str + ' has more than 14 characters');
+ if (str.length > 15) {
+ throw new Error('type ' + str + ' has more than 15 characters');
}
if (str.match(charset_regex)) {
throw new Error('type ' + str + ' may only contain alphanumeric ' +
@@ -170,7 +170,7 @@ function checkFormat(str) {
if (str.length === 0) {
throw new Error('type string must not be empty');
}
- if (str.length > 15) {
+ if (str.length > 16) { // 16 is correct because we have a leading underscore
throw new Error('type ' + _uu(str) + ' has more than 15 characters');
}
if ( ! str.match(format_regex)) {

0 comments on commit cddb0df

Please sign in to comment.