-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
lib: add case of no argument to ERR_INVALID_ARG_VALUE in errors.js #21262
Commits on Jun 11, 2018
-
lib: add case of no argument to ERR_INVALID_ARG_VALUE in errors.js
ERR_INVALID_ARG_VALUE is an error for wrong arguments given to the function. But calling a function without argument should also generate a sensible error message. For no argument case, parameter 'value' should be passed with zero value and the error message is generated. In readSync(fd, buffer, offset, length, position), triggers validateOffsetLengthRead() in lib/internal/fs/utils.js for validation. When buffer is empty, a weird message is generated "The value of offset is out of range.It must be >= 0 && <= 0. Received 0". There should be a special case when buffer is empty or bufferLength is zero, which should trigger ERR_INVALID_ARG_VALUE error. Fixes: nodejs#21193
Configuration menu - View commit details
-
Copy full SHA for f2f5c0c - Browse repository at this point
Copy the full SHA f2f5c0cView commit details -
lib: add case of no argument to ERR_INVALID_ARG_VALUE in errors.js
ERR_INVALID_ARG_VALUE is an error for wrong arguments given to the function. But calling a function without argument should also generate a sensible error message. For no argument case, parameter 'value' should be passed with zero value and the error message is generated. In readSync(fd, buffer, offset, length, position), triggers validateOffsetLengthRead() in lib/internal/fs/utils.js for validation. When buffer is empty, a weird message is generated "The value of offset is out of range.It must be >= 0 && <= 0. Received 0". There should be a special case when buffer is empty or bufferLength is zero, which should trigger ERR_INVALID_ARG_VALUE error. Fixes: nodejs#21193
Configuration menu - View commit details
-
Copy full SHA for e05f49c - Browse repository at this point
Copy the full SHA e05f49cView commit details -
lib: add case of bufferLength to validateOffsetLengthRead() in utils.js
In validateOffsetLengthRead(), an error message is generated if offset or length are out of range. There should also be an error message if buffer is empty, in which case it cannot write data in it. Generally this validateOffsetLengthRead() is triggered with fs.readSync(fd, buffer, offset, length, position), where if buffer is empty, the case for zero bufferLength is triggered and the corresponding message is thrown. Fixes: nodejs#21193
Configuration menu - View commit details
-
Copy full SHA for 7af6bb3 - Browse repository at this point
Copy the full SHA 7af6bb3View commit details
Commits on Jun 12, 2018
-
lib: add case of bufferLength to validateOffsetLengthRead() in utils.js
In validateOffsetLengthRead(), an error message is generated if offset or length are out of range. But there should also be an error message if buffer is empty, when no data can be written on it. Generally, validateOffsetLengthRead() is triggered with fs.readSync(fd, buffer, offset, length, position), where if 'buffer' is empty, the case for zero bufferLength should be triggered and the error message for empty buffer should be thrown. Fixes: nodejs#21193
Configuration menu - View commit details
-
Copy full SHA for 7c1d365 - Browse repository at this point
Copy the full SHA 7c1d365View commit details
Commits on Jun 16, 2018
-
lib: add empty buffer case to read and readSync function in fs
While using read() or readSync() function, it should be verified that the arguments of the function are in proper range and hold legitimate values, for a successful read process. For this validateOffsetLengthRead() function is called, which gives an error message for offset and length passed by the user, if not in order. But there should also be an error when an empty buffer is passed as argument, when it cannot be written over. The empty buffer case should be checked before calling validateOffsetLengthRead() and ERR_INVALID_ARG_VALUE should be thrown corresponding to the empty buffer argument in read and readSync function. Fixes: nodejs#21193
Configuration menu - View commit details
-
Copy full SHA for 8043755 - Browse repository at this point
Copy the full SHA 8043755View commit details
Commits on Jun 19, 2018
-
lib: add empty buffer case to read and readSync function in fs
While using read() or readSync() function, it should be verified that the arguments of the function are in proper range and hold legitimate values, for a successful read process. For this validateOffsetLengthRead() function is called, which gives an error message for offset and length passed by the user, if not in order. But there should also be an error when an empty buffer is passed as argument, when it cannot be written over. The empty buffer case should be checked before calling validateOffsetLengthRead() and ERR_INVALID_ARG_VALUE should be thrown corresponding to the empty buffer argument in read and readSync function. Fixes: nodejs#21193
Configuration menu - View commit details
-
Copy full SHA for a8c61fd - Browse repository at this point
Copy the full SHA a8c61fdView commit details