Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170757387
D24567.id70971.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D24567.id70971.diff
View Options
Index: sys/dev/iscsi_initiator/isc_subr.c
===================================================================
--- sys/dev/iscsi_initiator/isc_subr.c
+++ sys/dev/iscsi_initiator/isc_subr.c
@@ -97,6 +97,9 @@
int
i_setopt(isc_session_t *sp, isc_opt_t *opt)
{
+ char buf[16];
+ int error;
+
if(opt->maxRecvDataSegmentLength > 0) {
sp->opt.maxRecvDataSegmentLength = opt->maxRecvDataSegmentLength;
sdebug(2, "maxRecvDataSegmentLength=%d", sp->opt.maxRecvDataSegmentLength);
@@ -138,15 +141,21 @@
}
if(opt->headerDigest != NULL) {
- sdebug(2, "opt.headerDigest='%s'", opt->headerDigest);
- if(strcmp(opt->headerDigest, "CRC32C") == 0) {
+ error = copyinstr(opt->headerDigest, buf, sizeof(buf), NULL);
+ if (error != 0)
+ return (error);
+ sdebug(2, "opt.headerDigest='%s'", buf);
+ if(strcmp(buf, "CRC32C") == 0) {
sp->hdrDigest = (digest_t *)i_crc32c;
sdebug(2, "opt.headerDigest set");
}
}
if(opt->dataDigest != NULL) {
- sdebug(2, "opt.dataDigest='%s'", opt->headerDigest);
- if(strcmp(opt->dataDigest, "CRC32C") == 0) {
+ error = copyinstr(opt->dataDigest, buf, sizeof(buf), NULL);
+ if (error != 0)
+ return (error);
+ sdebug(2, "opt.dataDigest='%s'", opt->dataDigest);
+ if(strcmp(buf, "CRC32C") == 0) {
sp->dataDigest = (digest_t *)i_crc32c;
sdebug(2, "opt.dataDigest set");
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 7, 11:00 AM (4 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38464304
Default Alt Text
D24567.id70971.diff (1 KB)
Attached To
Mode
D24567: Don't run strcmp() against strings stored in user memory.
Attached
Detach File
Event Timeline
Log In to Comment