Showing error 1922

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/smbfs/proc.c
Line in file: 3293
Project: Linux Kernel
Project version: 2.6.28
Tools: Cppcheck (1.59)
Entered: 2013-10-17 18:38:34 UTC


Source:

3263        DEBUG1("readlink of %s/%s\n", DENTRY_PATH(d));
3264
3265        result = -ENOMEM;
3266        if (! (req = smb_alloc_request(server, PAGE_SIZE)))
3267                goto out;
3268        param = req->rq_buffer;
3269
3270        WSET(param, 0, SMB_QUERY_FILE_UNIX_LINK);
3271        DSET(param, 2, 0);
3272        result = smb_encode_path(server, param+6, SMB_MAXPATHLEN+1, d, NULL);
3273        if (result < 0)
3274                goto out_free;
3275        p = param + 6 + result;
3276
3277        req->rq_trans2_command = TRANSACT2_QPATHINFO;
3278        req->rq_ldata = 0;
3279        req->rq_data  = NULL;
3280        req->rq_lparm = p - param;
3281        req->rq_parm  = param;
3282        req->rq_flags = 0;
3283        result = smb_add_request(req);
3284        if (result < 0)
3285                goto out_free;
3286        DEBUG1("for %s: result=%d, rcls=%d, err=%d\n",
3287                &param[6], result, req->rq_rcls, req->rq_err);
3288
3289        /* copy data up to the \0 or buffer length */
3290        result = len;
3291        if (req->rq_ldata < len)
3292                result = req->rq_ldata;
3293        strncpy(buffer, req->rq_data, result);
3294
3295out_free:
3296        smb_rput(req);
3297out:
3298        return result;
3299}
3300
3301
3302/*
3303 * Create a symlink object called dentry which points to oldpath.
Show full sources